dotnet / docfx

Static site generator for .NET API documentation.
https://dotnet.github.io/docfx/
MIT License
4.08k stars 865 forks source link

[Bug] PDF load failure when creating pdf with many pages #8667

Closed MiTschMR closed 1 year ago

MiTschMR commented 1 year ago

Describe the bug The new PdfPig integration that replaced the existing html to pdf implementation throws the following errors when generating a pdf with 317 pages:

Error: Failed to load file:///<path to documentation>/_sitepdf/_raw/_sitepdf/fonts/glyphicons-halflings-regular.woff, with network status code 203 and http status code 0 - Error opening <path to documentation>/_sitepdf/_raw/_sitepdf/fonts/glyphicons-halflings-regular.woff: The system cannot find the path specified.
Error: Failed to load file:///<path to documentation>/_sitepdf/_raw/_sitepdf/fonts/glyphicons-halflings-regular.ttf, with network status code 203 and http status code 0 - Error opening <path to documentation>/_sitepdf/_raw/_sitepdf/fonts/glyphicons-halflings-regular.ttf: The system cannot find the path specified.
Error: Failed to load file:///<path to documentation>/_sitepdf/_raw/_sitepdf/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular, with network status code 203 and http status code 0 - Error opening <path to documentation>/_sitepdf/_raw/_sitepdf/fonts/glyphicons-halflings-regular.svg: The system cannot find the path specified.
Counting pages (2/6)
Warning: Received createRequest signal on a disposed ResourceObject's NetworkAccessManager. This might be an indication of an iframe taking too long to load.
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
Error: Failed to load about:blank, with network status code 301 and http status code 0 - Protocol "about" is unknown
Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
Documentation_pdf.pdf is generated based on pdf/toc.json under folder <path to documentation>\_sitepdf
Completed Scope:PDF in 102518.8224 milliseconds.

To Reproduce Steps to reproduce the behavior:

  1. Create a docfx project with many different pages (I can provide mine in private if desired to troubleshoot)
  2. Generate the pdf

Expected behavior No errors are thrown.

Context (please complete the following information):

Additional context This does not happen on a documentation project with only 15 pages of generated pdf.

yufeih commented 1 year ago

Does the pdf command produce PDF files? It seems the same error appears also in 2.65.2.

MiTschMR commented 1 year ago

It does produce a valid output pdf.

larswestman commented 1 year ago

This error is also in 2.71.0

yufeih commented 1 year ago

v2.73.0 may fix this with a new PDF engine.