Closed cedar-ave closed 5 years ago
I am observing broken links in PDFs as well, with docfx 2.42.1 and wkhtmltopdf 0.12.5 (both installed via chocolatey), whereas the links work fine with docfx 2.41 and wkhtmltopdf 0.12.5
@cedar-ave @PatrickLehnerXI Can you provide some repos to help reproduce the issue?
/cc @icnocop
It seems to be a bug in PDFSharp.
I created issue https://github.com/empira/PDFsharp/issues/84 which is related to broken links in PDFs.
It's a result of replacing iTextSharp with PDFSharp as part of https://github.com/dotnet/docfx/issues/4250. 😢
I'm wondering if we should revert the code back to iTextSharp?
Thank you.
@icnocop I'm afraid yes...
I created PR #4467 which reverts PDFSharp back to iTextSharp.
With the revert to iTextSharp is there potential for #2446 to recur? If so, I would rather experience this bug than that one.
I think the issue where "cross-reference links often go to the middle of a section instead of top" is a bug in wkhtmltopdf.
See https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1947.
I haven't got as far as trying to compile wkhtmltopdf yet to verify the proposed fix.
Operation System: (
Windows
orLinux
orMacOS
) WindowsDocFX Version Used: 2.42
Template used:
pdf.default
+ custom templateSteps to Reproduce: Generate multiple PDFs using
docfx pdf
.Expected Behavior: Table of Contents links go to specified location within the PDF.
Actual Behavior: In some cases, Table of Contents links go nowhere. In those cases, internal links to other places in the PDF fail as well. Number of pages may be a determinant. As a very general rule based on the 20 PDFs I produced, the TOC appears to work on smaller PDFs (approx. <75 pages) and not work on larger PDFs (approx >100 pages). However there was at least 1 exception to that. File size does not seem to be a determinant.