Skip to content
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

Unable to fully generate PDF file, getting reference errors generating PDF outline #674

Open
woodbe opened this issue Nov 29, 2022 · 4 comments
Labels
🐛 bug Something isn't working 🙃 upstream

Comments

@woodbe
Copy link

woodbe commented Nov 29, 2022

I am trying to generate a PDF using the attached adoc file (inside the ZIP). The file generates both HTML and PDF output normally (I have attached those copies for reference), but when using the web-pdf generator instead I get a number of errors output (see the log file, this is just the screen output).

The PDF and HTML files names with webpdftest are the output from the same source. The PDF file is about 75 pages instead of the 140 or so it should be (and the TOC has everything as page 0 with no links), and the HTML is also very short compared to what it should be.

The errors generated all seem to be about inforrece anchor links, but I don't see any problems when I generate the files using the more traditional asciidoctor programs.

Any help would be appreciated.

web-pdf-test.zip

This is being run from the released version for Windows (being run through Powershell).

@ggrossetie
Copy link
Owner

This is a know issue with Paged.js. When the Paged.js engine cannot layout an element it will skip it (i.e. truncate the document). That's the reason why some pages are missing and as a result some sections (section are missing from the table of content (more specifically section title references).

At some point, we might try to use another engine called https://github.com/vivliostyle/vivliostyle.js. Maybe it will give us better result.

If you can create a small reproduction case, I encourage you to report this issue at https://gitlab.coko.foundation/pagedjs/pagedjs/

@ggrossetie ggrossetie added the 🐛 bug Something isn't working label Nov 29, 2022
@mrombout
Copy link

mrombout commented Aug 1, 2023

At some point, we might try to use another engine called https://github.com/vivliostyle/vivliostyle.js. Maybe it will give us better result.

I'm looking into Vivliostyle because I ran into some limitations with Paged.js as well.

For what it's worth I quickly ran the document through asciidoctor, asciidoctor-web-pdf and vivliostyle to get a general feel of their flow. At least it produces a ~140 page document. Obviously it needs a lot of tweaks for the style to look good.

Are there any serious plans or a vision on how Vivliostyle would fit into asciidoctor-web-pdf or the Asciidoctor ecosystem as a whole?

@haekelhexe
Copy link

haekelhexe commented Oct 26, 2023

Do I understand it correctly, that anchors in general do not work? Is there a workaround other than using vivliostyle?
I would like to generate a document in order to be able to modify the css. But if I cannot create a document at all then it's not worth the effort and I have to stick to asciidoctor-pdf.

EDIT:
Just saw issue #267 and this is related. So it's my table that ruins the PDF creation

@ggrossetie
Copy link
Owner

Do I understand it correctly, that anchors in general do not work? Is there a workaround other than using vivliostyle?
I would like to generate a document in order to be able to modify the css. But if I cannot create a document at all then it's not worth the effort and I have to stick to asciidoctor-pdf.

It's not really anchors but rather missing contents. Paged.js will skip elements (i,e., contents) when it cannot figure out how to make them fit into a page.

Just saw issue #267 and this is related. So it's my table that ruins the PDF creation

Tables are notoriously difficult to gracefully chunk into multiple pages because they have a rigid/strict layout. It gets worse when the table contains images or colspans/rowspans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🙃 upstream
Projects
None yet
Development

No branches or pull requests

4 participants