vscode-markdown-preview-enhanced icon indicating copy to clipboard operation
vscode-markdown-preview-enhanced copied to clipboard

Export to PDF (prince) not coloring full page

Open DolphinDream opened this issue 1 year ago • 0 comments

Description When using prince css settings to color the entire page a given color the export to PDF from this extension generates a PDF that has white background. Entering the same css (and html) on the prince’s site directly it generates a correct PDF. See the attachments.

Environment

  • VSCode: 1.85.1
  • Markdown Preview Enhanced: 0.8.11

How to reproduce Use a simple markdown (See “Some Document.md” attachment) (multiple paragraphs with title and headings).. and the css settings to color the entire page a given color (for prince pdf export)

body {
  background-color: plum;
  padding: 50px;
}

@page {
  background-color: plum;
  padding: 100px;
  margin: 50px;
}

with proper integration in the extension’s style.less file:

/* Please visit the URL below for more information: */
/*   https://shd101wyy.github.io/markdown-preview-enhanced/#/customize-css */

.markdown-preview.markdown-preview {
  &.prince {
    body {
      background-color: plum;
      padding: 50px;
    }

    @page {
      background-color: plum;
      padding: 100px;
      margin: 50px;
    }
  }
}

The same markdown (as html) / css entered on prince’s site (https://www.princexml.com/try/) generates this PDF (entire page is plum).

Screen Shot 2023-12-20 at 5 57 40 PM

Some Document - prince.pdf

While the Markdown Preview Enhanced extension generates this PDF (edges of the page are plum with the center white)

Screen Shot 2023-12-20 at 5 57 54 PM

Some Document.pdf

The original markdown:

Some Document.md

And the html entered on prince’s site (same content as the markdown):

Some Document.html.zip

DolphinDream avatar Dec 20 '23 23:12 DolphinDream