-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export to pdf is not rendering math expressions and pictures #239
Comments
I think there is two unrelated things here. The lack of embedding images is an upstream issue, see wkhtmltopdf/wkhtmltopdf#2687. To work around this I believe if you set The lack of equations seems to be a problem with SSL negotiation in wkhtmltopdf. I could reproduce this issue in @joaompinto can we update to 0.12.5? I'm not sure what process we use for retrieving and updating these binaries. Note that the other option is to use I might look into doing a PR to provide |
Prepare for compatibility with asciidoctor-pdf.js, related to #239
Note that using I can confirm that both images and math work just fine with it out of the box and IMHO although it is still in alpha it is looking really good (thank you @Mogztter). Within the @joaompinto we could consider bundling or adding this "on demand" at some stage. Bundling is attractive except that it would increase the extension filesize significantly because of the Chrome binary. I'm not sure if it's possible with a vs-code extension to load a node package on demand (like we do with wkhtmltopdf) but if we could that would be really neat. |
An intermediate step could be to configure the binary path to chrome? I mean it would require some changes to Do you think it's worth it? |
The binaries are download from https://github.com/asciidoctor/asciidoctor-vscode/tree/master/wkhtmltopdf-bin (using raw), but there is no "upgrade" logic :( |
Unfortunately there are no generic upstream binaries for 0.12.5 https://github.com/wkhtmltopdf/wkhtmltopdf/releases. The "Export to PDF" option on the editor is expected to be a quick/simple export option, it does not need to support all the bells & whistles of a well tuned PDF generator. What would we lose on switching to asciidoctor-pdf (JS) as it stands now ? |
Thanks -- Yes, the build infrastructure seems to be somewhat inconsistent/broken. I also looked at https://builds.wkhtmltopdf.org/ which is even more patchy. It looks like there is some ongoing work in automating builds (see wkhtmltopdf/wkhtmltopdf#4578 (comment)). I don't think we want to get into compiling binaries for another project to support this feature. @Mogztter:
Puppeteer suggests keeping Chromium versions in lock-step and provides no guarantee that things will work. But maybe they would work well enough for our use case? I worry that we'll end up trying to follow user's individual installation/environment issues or other incompatibilities. I guess we could try it and see? I don't think the size of asciidoctor-pdf.js is a problem unless we bundle it into this extension directly. The extension is currently 8.8 Mb. Puppeteer is 118 Mb and a zipped I think it would be pleasing to re-use the "download on demand" logic in this extension with an asciidoctor-pdf binary which looks like it might not be very difficult (see ggrossetie/asciidoctor-web-pdf#137). We might need to provide a warning about the total size. Ideally we wouldn't have any user pre-requisites like ("you must install Chrome" or "you must install asciidoctor-pdf.js prior"). Many users don't have much control over their environment and that would be a showstopper for them.
If we switched by adding it as a package for node the extension would be excessively large. Not everyone has an unmetered high bandwidth connection and new extension releases would start to be a significant amount of data... I would like to look into using an asciidoctor-pdf binary sometime (maybe the next few months, my free time comes to an end in about a week). |
Do you have a more complete example? I'm trying to get images into a PDF rendered based on a ADOC document using When enabling the setting
Changing images to be PNGs works and images are available, but they look bad. The PNG itself is OK, but some renders have problems with screenshots of Windows dialogs like these and apply transparency where simply black color should be used instead and stuff. The preview in VScode shows these PNGs badly as well, while IrfanView and GIMP show the PNGs just fine. That's why I tried WEBP, that is supported by the preview, shows just fine, but isn't available in the resulting PDF anymore. Is there any additional option to make WEBP available in the PDF? |
Found the error, simply adding |
Another workaround: While IrfanView and Gimp render those images properly, e.g. IrfanView simply allows to store PNG without any transparency at all. So when one knows that this isn't needed, simply disable it and images look fine even in the browser. Should have thought about that earlier. :-) |
Description
When you use the export to pdf option math expressions and pictures are not rendered.
System Information
OS: Arch Linux 5.3.13 kernel version
VSCode version: 1.40.2
Asciidoctor extension: v2.7.7
To Reproduce
Steps to reproduce the issue:
.adoc
example document with a MWE like this onectrl+shift+p
to open the command palette and chooseAciiDoc: Export document as PDF
Screenshots & Files
Additional Context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: