jsnee / vscode-dmbinder

Visual Studio Code extension for managing campaign documents.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Backgrounds / Stylesheet Images Not Loading

djfariel opened this issue · comments

Heyyo, I'm having trouble getting the default background image to load from the CSS. My guess is that it's rendering "too fast" and outputting to file before that image is loaded. I've tried half a dozen different versions of chromium even up to 891643 and it's the same result every time. I've also confirmed that images are working correctly, as you can see here in preview and render.
image
image

I found a number of issues on Puppeteer's side mentioning that it's not waiting for background images specifically to finish before saying it's done rendering. I haven't tracked this further (maybe a chromium issue but I can't get older versions to work with puppeteer).

A guess on a temporary workaround would be to add a tenth of a second pause on the render for each page. It's a gross hack but I can wait a few seconds for my docs to not be ugly.

Hey just kidding, I think adding printBackground: true to the pdf options on lines 153-157 at src/homebrewery/renderer.ts might solve it.

Edit: Can confirm that this works; I edited the extension locally. Don't know a darn thing about vscode extensions nor if there's a reason you left this out, so I won't put in a PR. Thank you for this amazing tool.

commented

@djfariel: How did you get the code to compile to install into your VSCode? As I seem to be having this problem that I mentioned in #30, and I would prefer to use VSCOde-DMBinder as opposed to Homebrewery, for the times I am offline.

@jsnee Could you kindly build and release a fixed version of this for those that have no idea how to compile code?

Good to know, I'll try and get this integrated into a new build shortly!

@djfariel Can you confirm this is fixed in the latest build of the extension? (0.5.13)

Closing this issue. No response from requester. @djfariel feel free to comment on this issue if you are still having issues.