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

Content of PDF files comes out scambled #9868

Open
ArDevKarl opened this issue Apr 12, 2024 · 2 comments
Open

Content of PDF files comes out scambled #9868

ArDevKarl opened this issue Apr 12, 2024 · 2 comments
Labels
bug A bug to fix pdf Produce PDF as the output format

Comments

@ArDevKarl
Copy link

ArDevKarl commented Apr 12, 2024

Describe the bug
I'm trying to generate a simple PDF of my API, without any styles/template. THe resulting pdf looks all scambled:
Screenshot 2024-04-12 132934

To Reproduce
My docfx.json:

{
  "metadata": [
    {
      "src": [
        {
          "src": "./..",
          "files": [
            "Assembly-CSharp.csproj"
          ]
        }
      ],
      "dest": "api",
      "disableGitFeatures": false,
      "disableDefaultFilter": false,
      "filter": "filterConfig.yml"
    }
  ],
  "build": {
     "globalMetadata": {
      "pdf": true,
      "pdfTocPage": true
    },    
    "content": [
      {
        "files": [
          "api/**.yml",
          "api/index.md"
        ]
      },
      {
        "files": [
          "toc.yml",
          "*.md"
        ]
      }
    ],
    "overwrite": [
      {
        "files": [
          "apidoc/**.md"
        ],
        "exclude": [
          "obj/**",
          "_site/**"
        ]
      }
    ],
    "dest": "_site",
    "globalMetadataFiles": [],
    "fileMetadataFiles": [],
    "postProcessors": [],
    "markdownEngineName": "markdig",
    "noLangKeyword": false,
    "keepFileLink": false,
    "cleanupCacheHistory": false,
    "disableGitFeatures": false
  }
}

Expected behavior
A PDF file with readable content without any styling

Context (please complete the following information):

  • OS: Windows 11
  • Docfx version: 2.76.0

Is this a bug or is it mandetory, to add styling?

@ArDevKarl ArDevKarl added the bug A bug to fix label Apr 12, 2024
@filzrev
Copy link
Contributor

filzrev commented Apr 13, 2024

without any styles/template.

When template is not specified. default template is used as fallback value.

It seems same problems that are reported at (#9653)


I can also reproduce problem on my environment (Windows 11)
with following steps.

  1. Edit docfx official docs docfx.json to use default template only
  2. Run docfx build command
  3. Run docfx pdf command
  4. Following warnings displayed. and PDF content is corrupted.

warning: Timeout waiting for page to load, generated PDF page may be incomplete: http://127.0.0.1:59028/docfx-cli-reference/docfx.html
warning: Timeout waiting for page to load, generated PDF page may be incomplete: http://127.0.0.1:59028/docfx-cli-reference/docfx.html

And it can't be resolved with DOCFX_PDF_TIMEOUT settings.

It seems there is problem in docfx-cli-reference/docfx.md content.
And it can also reproduce problems with following minimum markdown/yml file.

sample.md

# docfx

toc.yml

- name: Sample
  href: sample.md

@filzrev
Copy link
Contributor

filzrev commented Apr 13, 2024

For docfx heading element problems.
It seems be occurred by following logics.
https://github.com/dotnet/docfx/blob/b7285fcdfb04e6f4132d702217588de6236bfa4c/src/Docfx.App/PdfBuilder.cs#L161C1-L161C92

It's not completed if docfx ID element exists (and docfx.ready variable is not set when using default template)


For wrong PDF content generated problem.
It seems currently not supported usage. (As discussed at #9393)
And Create PDF Files document have following note exists.

This article applies to docfx 2.73.0 or greater and the modern site template.

@yufeih yufeih added the pdf Produce PDF as the output format label Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix pdf Produce PDF as the output format
Projects
None yet
Development

No branches or pull requests

3 participants