Window becomes messed up when exporting to PDF

Bug report

When I export a note, regardless of the length, to PDF there is an artifact that shows up at the bottom of the window and pushes everything up making the top part of the window inaccessible.


The theme being used is the default dark theme. This appears to only happen when the note is viewed in Distraction Free Mode and not in the regular mode, returning to the regular mode does not resolve the issue.

These are the only entries found in the console

electron/js2c/renderer_init.js:13 (electron) The remote module is deprecated. Use https://github.com/electron/remote instead.
log @ electron/js2c/renderer_init.js:13
<embedded>:44441 The vm module of Node.js is deprecated in the renderer process and will be removed.
get_console @ <embedded>:44441
DevTools failed to load SourceMap: Could not parse content for file:///usr/lib/inkdrop/resources/app.asar/code.js.map: Unexpected end of JSON input
DevTools failed to load SourceMap: Could not parse content for file:///usr/lib/inkdrop/resources/app.asar/browser-commons.js.map: Unexpected end of JSON input
DevTools failed to load SourceMap: Could not parse content for file:///usr/lib/inkdrop/resources/app.asar/browser-main.js.map: Unexpected end of JSON input
DevTools failed to load SourceMap: Could not parse content for file:///usr/lib/inkdrop/resources/app.asar/browser-exports.js.map: Unexpected end of JSON input
DevTools failed to load SourceMap: Could not parse content for file:///usr/lib/inkdrop/resources/app.asar/main.css.map: Unexpected end of JSON input

Info

  • Platform: Arch Linux
  • Platform version: 5.11.21
  • App Version: 5.3.0

Reproduce

I can recreate the issue with the following steps

  1. Create or open a new note in Distraction Free mode
  2. Export the note to PDF
  3. Switch to another window
  4. Return to the note
  5. Click on the body or title of the note

The artifact or frame appears at the bottom. It doesn’t always appear immediately, it may take a couple of tries, however, it is repeatable.

Hi Nicole,

Thank you for reporting.
That’s weird. The artifact looks like a webview created for exporting, but not hidden for some reason.
I tried to reproduce it with the given steps but couldn’t.
It seems that you are using some plugins.
How about disabling them?
Because I’ve got several issues that were caused by a plugin.
Hope that helps.

Ah, yes, it appears that the basyura/inkdrop-sidetoc is the culprit here. I disabled all of the plugins and then enabled one by one and tested with the steps that I mentioned in my original post, when exporting to PDF and then clicking on the sidetoc it shows the webview that is created.

Great!
@shimizu_tatsuya, can you please look into it?

I could reproduce it.
I’ll try to fix it.

1 Like

  • WebView is added every time PDF is output, and layout becomes messed up.
  • If adding the display: none attribute to the WebView, it doesn’t become messed up.

Probably a sidetoc style issue, but I can’t solve it right away (css is difficult…)

First, you don’t have to specify height as it’s in a flex layout:

Looks like it happens when you scroll the editor or preview.
I guess the layout corrupts when the plugin calls scrollIntoView because it scrolls the entire page instead of just the sidetoc panel.
So, instead of calling scrollIntoView, you can accomplish that by doing like so:

I don’t remember why webviews don’t have display: none. I’ll check it later!

Thanks Takuya さん.

Maybe I could fix it.

First, you don’t have to specify height as it’s in a flex layout:

I met the similar problem before (window messed up).
So, I set the calculated height.
I check this later.

1 Like

I confirmed that it’s been solved!

That’s interesting. Does it happen only on Windows?
Flex layouts basically should do that automatically.

It’s (inkdrop’s) window, not Windows OS.

I published sidetoc 1.11.0.
@Nicole_Daniella can you update and test?

1 Like

Yes, will be testing and report back

I can confirm that the issue has been resolved. Thanks for resolving the issue :slight_smile:

1 Like

Great work! Let me know if you got the layout issue again.

I fixed the app to remove a webview immediately after finishing the export.
Published v5.3.1 :tada: (Changelog)
Thanks again for the report!

1 Like