jsnee/vscode-dmbinder

Issue with exporting files

rjbprime opened this issue · 9 comments

Not sure what's going on, but the last couple of days, whenever I have been trying to export a files as pdf, it only renders part of the file, such that either the majority of text is missing, or the background is corrupted. Could this be a Puppeteer issue or something else? As copying the code into homebrewery itself, the files work.

jsnee commented

It's quite possible, I don't suppose you'd be willing to share an example file?

jsnee commented

I did see one of the files rendered without the background texture at first, but then it seemed to fix itself the next time I exported the file. My best guess is that it may be puppeteer related. Are you using a version of Chromium installed by Puppeteer (through this extension) or did you choose to use a local Chrome executable?

Puppeteer installed version. Is it a case of re-render until it works?

jsnee commented

That very well may get you a properly exported version, but I don't find that an acceptable solution, so I'm going to continue to try and troubleshoot if you don't mind helping me out. If you go into your settings what is the value of this setting:
image

jsnee commented

Ah, I may have figured out the issue. I'm going to run some testing first, but unless I see any issues, I'm going to update the extension and have you try it out.

jsnee commented

Done! Once you update your extension to version 0.5.9, you shouldn't encounter those issues anymore. If you do, please let me know!

For some reason the current version of the plugin is now increasing the file size of my exported PDFs. I kept a copy of the previous markdown file, which has similar content but 5 less pages, and exporting it has created a roughly 8mb file, whereas the new file is exported as a roughly 19mb file. They both use similar content, besides the original having 5 less pages, the only other change is I made the map in the guide take up 4 pages instead of part of one, and a mostly blank page as a spacer.

I have managed to reduce the file size by half for the new doc, but compressing all the images in use. Doing this, the doc exported as a 10mb file, still more than the older doc, even with the compressed images.

Is there a way to determine the version of Chromium used for export? When I use Homebrewery or GMBinder, I write the doc in the current Chrome version, then share it so that I can open the share link in Chromium v64.0.3282.186-r520840-win64, as it exports at a fraction of the file size of current or recent versions of Chrome. Only thing I'm unsure on is what CSS or other things are not available.

Could this version be looked into as the version in use? I'd much prefer to be able to share my work via discord to my players, as a small PDF then have to give them a link to a large one, as half my players are on 3g pocket wifi with limited plans.

jsnee commented

The version should be listed in your VSCode settings in the DMBinder section. It is possible to run this command and browse to and select your installed version of Chrome instead (or a separately downloaded version of Chromium.

image

My guess is that the images you have included are significantly large and that is what is impacting your PDF size. If you feel that there was a change in the plugin that caused this, you could try exporting it with an older version to see if that makes any difference. If it does, then that would be something that I could look into. Here's how you can change the version of the plugin you're running:
image

I'd suggest trying to point the plugin to that version of Chromium that you use, first, as that seems the best candidate for fixing your solution.