Skip to content

[Bug] Footer and page size incorrect for custom printed layout #10087

@cjlotz

Description

@cjlotz

Describe the bug
Using the new #9850 feature to specify a custom layout, the footer containing page numbers is not positioned correctly. The page content is also not scaled correctly to fit onto the page

To Reproduce
Steps to reproduce the behavior:

  1. Add custom CSS as in feat: Enable PreferCSSPageSize option for PDF generation #9850 to force custom print layout
@media print {
    @page {
        size: A4 landscape;
    }    
}
  1. Build and run docfx to create output that includes pdf settings like the following sample globalMetadata
    "globalMetadata": {
      "_appTitle": "On Key Release Notes",
      "_appFooter": "On Key Plus 2024.13.0 (Build 0)",
      "_appFaviconPath": "images/favicon.png",
      "_appLogoPath": "images/onkey_icon.png",
      "_enableNewTab": true,
      "_enableSearch": true,
      "_disableNavBar": "true",
      "_disableBreadcrumb": "true",
      "_disableToc": "false",
      "_disableAffix": "false",
      "pdf": true,
      "pdfTocPage": true,
      "pdfFileName": "onkey_releasenotes.pdf",
      "pdfPrintBackground": true
    },

Generated output

image

Notice that the page content is not scaled to fix onto the page (nr 2) and that the footer is not positioned correctly (nr 1) as illustrated above

Context (please complete the following information):

  • OS: Windows
  • Docfx version: 2.77.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    pdfProduce PDF as the output format

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions