Coder Social home page Coder Social logo

yzane / vscode-markdown-pdf Goto Github PK

View Code? Open in Web Editor NEW
939.0 21.0 196.0 35.15 MB

Markdown converter for Visual Studio Code

Home Page: https://marketplace.visualstudio.com/items?itemName=yzane.markdown-pdf

License: Other

JavaScript 83.61% CSS 15.34% HTML 1.05%
markdown vscode pdf visual-studio-code plantuml mermaid vscode-extension

vscode-markdown-pdf's Introduction

Markdown PDF

This extension converts Markdown files to pdf, html, png or jpeg files.

Japanese README

Table of Contents

Specification Changes

  • Default Date Format for PDF Headers and Footers Modified
    • Starting from version 1.5.0, the default date format for headers and footers has been changed to the ISO-based format (YYYY-MM-DD).
    • This change aims to improve the consistency of date displays, as the previous format could vary depending on the environment.
    • If you wish to use the previous format, please refer to markdown-pdf.headerTemplate.

Features

Supports the following features

Sample files

markdown-it-container

INPUT

::: warning
*here be dragons*
:::

OUTPUT

<div class="warning">
<p><em>here be dragons</em></p>
</div>

markdown-it-plantuml

INPUT

@startuml
Bob -[#red]> Alice : hello
Alice -[#0000FF]->Bob : ok
@enduml

OUTPUT

PlantUML

markdown-it-include

Include markdown fragment files: :[alternate-text](relative-path-to-file.md).

├── [plugins]
│  └── README.md
├── CHANGELOG.md
└── README.md

INPUT

README Content

:[Plugins](./plugins/README.md)

:[Changelog](CHANGELOG.md)

OUTPUT

Content of README.md

Content of plugins/README.md

Content of CHANGELOG.md

mermaid

INPUT

```mermaid
stateDiagram
    [*] --> First
    state First {
        [*] --> second
        second --> [*]
    }
```

OUTPUT

mermaid

Install

Chromium download starts automatically when Markdown PDF is installed and Markdown file is first opened with Visual Studio Code.

However, it is time-consuming depending on the environment because of its large size (~ 170Mb Mac, ~ 282Mb Linux, ~ 280Mb Win).

During downloading, the message Installing Chromium is displayed in the status bar.

If you are behind a proxy, set the http.proxy option to settings.json and restart Visual Studio Code.

If the download is not successful or you want to avoid downloading every time you upgrade Markdown PDF, please specify the installed Chrome or 'Chromium' with markdown-pdf.executablePath option.

Usage

Command Palette

  1. Open the Markdown file
  2. Press F1 or Ctrl+Shift+P
  3. Type export and select below
    • markdown-pdf: Export (settings.json)
    • markdown-pdf: Export (pdf)
    • markdown-pdf: Export (html)
    • markdown-pdf: Export (png)
    • markdown-pdf: Export (jpeg)
    • markdown-pdf: Export (all: pdf, html, png, jpeg)

usage1

Menu

  1. Open the Markdown file
  2. Right click and select below
    • markdown-pdf: Export (settings.json)
    • markdown-pdf: Export (pdf)
    • markdown-pdf: Export (html)
    • markdown-pdf: Export (png)
    • markdown-pdf: Export (jpeg)
    • markdown-pdf: Export (all: pdf, html, png, jpeg)

usage2

Auto convert

  1. Add "markdown-pdf.convertOnSave": true option to settings.json
  2. Restart Visual Studio Code
  3. Open the Markdown file
  4. Auto convert on save

Extension Settings

Visual Studio Code User and Workspace Settings

  1. Select File > Preferences > UserSettings or Workspace Settings
  2. Find markdown-pdf settings in the Default Settings
  3. Copy markdown-pdf.* settings
  4. Paste to the settings.json, and change the value

demo

Options

List

Category Option name Configuration scope
Save options markdown-pdf.type
markdown-pdf.convertOnSave
markdown-pdf.convertOnSaveExclude
markdown-pdf.outputDirectory
markdown-pdf.outputDirectoryRelativePathFile
Styles options markdown-pdf.styles
markdown-pdf.stylesRelativePathFile
markdown-pdf.includeDefaultStyles
Syntax highlight options markdown-pdf.highlight
markdown-pdf.highlightStyle
Markdown options markdown-pdf.breaks
Emoji options markdown-pdf.emoji
Configuration options markdown-pdf.executablePath
Common Options markdown-pdf.scale
PDF options markdown-pdf.displayHeaderFooter resource
markdown-pdf.headerTemplate resource
markdown-pdf.footerTemplate resource
markdown-pdf.printBackground resource
markdown-pdf.orientation resource
markdown-pdf.pageRanges resource
markdown-pdf.format resource
markdown-pdf.width resource
markdown-pdf.height resource
markdown-pdf.margin.top resource
markdown-pdf.margin.bottom resource
markdown-pdf.margin.right resource
markdown-pdf.margin.left resource
PNG JPEG options markdown-pdf.quality
markdown-pdf.clip.x
markdown-pdf.clip.y
markdown-pdf.clip.width
markdown-pdf.clip.height
markdown-pdf.omitBackground
PlantUML options markdown-pdf.plantumlOpenMarker
markdown-pdf.plantumlCloseMarker
markdown-pdf.plantumlServer
markdown-it-include options markdown-pdf.markdown-it-include.enable
mermaid options markdown-pdf.mermaidServer

Save options

markdown-pdf.type

  • Output format: pdf, html, png, jpeg
  • Multiple output formats support
  • Default: pdf
"markdown-pdf.type": [
  "pdf",
  "html",
  "png",
  "jpeg"
],

markdown-pdf.convertOnSave

  • Enable Auto convert on save
  • boolean. Default: false
  • To apply the settings, you need to restart Visual Studio Code

markdown-pdf.convertOnSaveExclude

  • Excluded file name of convertOnSave option
"markdown-pdf.convertOnSaveExclude": [
  "^work",
  "work.md$",
  "work|test",
  "[0-9][0-9][0-9][0-9]-work",
  "work\\test"  // All '\' need to be written as '\\' (Windows)
],

markdown-pdf.outputDirectory

  • Output Directory
  • All \ need to be written as \\ (Windows)
"markdown-pdf.outputDirectory": "C:\\work\\output",
  • Relative path
    • If you open the Markdown file, it will be interpreted as a relative path from the file
    • If you open a folder, it will be interpreted as a relative path from the root folder
    • If you open the workspace, it will be interpreted as a relative path from the each root folder
"markdown-pdf.outputDirectory": "output",
  • Relative path (home directory)
    • If path starts with ~, it will be interpreted as a relative path from the home directory
"markdown-pdf.outputDirectory": "~/output",
  • If you set a directory with a relative path, it will be created if the directory does not exist
  • If you set a directory with an absolute path, an error occurs if the directory does not exist

markdown-pdf.outputDirectoryRelativePathFile

  • If markdown-pdf.outputDirectoryRelativePathFile option is set to true, the relative path set with markdown-pdf.outputDirectory is interpreted as relative from the file
  • It can be used to avoid relative paths from folders and workspaces
  • boolean. Default: false

Styles options

markdown-pdf.styles

  • A list of local paths to the stylesheets to use from the markdown-pdf
  • If the file does not exist, it will be skipped
  • All \ need to be written as \\ (Windows)
"markdown-pdf.styles": [
  "C:\\Users\\<USERNAME>\\Documents\\markdown-pdf.css",
  "/home/<USERNAME>/settings/markdown-pdf.css",
],
  • Relative path
    • If you open the Markdown file, it will be interpreted as a relative path from the file
    • If you open a folder, it will be interpreted as a relative path from the root folder
    • If you open the workspace, it will be interpreted as a relative path from the each root folder
"markdown-pdf.styles": [
  "markdown-pdf.css",
],
  • Relative path (home directory)
    • If path starts with ~, it will be interpreted as a relative path from the home directory
"markdown-pdf.styles": [
  "~/.config/Code/User/markdown-pdf.css"
],
"markdown-pdf.styles": [
  "https://xxx/markdown-pdf.css"
],

markdown-pdf.stylesRelativePathFile

  • If markdown-pdf.stylesRelativePathFile option is set to true, the relative path set with markdown-pdf.styles is interpreted as relative from the file
  • It can be used to avoid relative paths from folders and workspaces
  • boolean. Default: false

markdown-pdf.includeDefaultStyles

  • Enable the inclusion of default Markdown styles (VSCode, markdown-pdf)
  • boolean. Default: true

Syntax highlight options

markdown-pdf.highlight

  • Enable Syntax highlighting
  • boolean. Default: true

markdown-pdf.highlightStyle

"markdown-pdf.highlightStyle": "github.css",

Markdown options

markdown-pdf.breaks

  • Enable line breaks
  • boolean. Default: false

Emoji options

markdown-pdf.emoji

Configuration options

markdown-pdf.executablePath

  • Path to a Chromium or Chrome executable to run instead of the bundled Chromium
  • All \ need to be written as \\ (Windows)
  • To apply the settings, you need to restart Visual Studio Code
"markdown-pdf.executablePath": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"

Common Options

markdown-pdf.scale

  • Scale of the page rendering
  • number. default: 1
"markdown-pdf.scale": 1

PDF options

markdown-pdf.displayHeaderFooter

  • Enables header and footer display
  • boolean. Default: true
  • Activating this option will display both the header and footer
  • If you wish to display only one of them, remove the value for the other
  • To hide the header
    "markdown-pdf.headerTemplate": "",
  • To hide the footer
    "markdown-pdf.footerTemplate": "",

markdown-pdf.headerTemplate

  • Specifies the HTML template for outputting the header
  • To use this option, you must set markdown-pdf.displayHeaderFooter to true
  • <span class='date'></span> : formatted print date. The format depends on the environment
  • <span class='title'></span> : markdown file name
  • <span class='url'></span> : markdown full path name
  • <span class='pageNumber'></span> : current page number
  • <span class='totalPages'></span> : total pages in the document
  • %%ISO-DATETIME%% : current date and time in ISO-based format (YYYY-MM-DD hh:mm:ss)
  • %%ISO-DATE%% : current date in ISO-based format (YYYY-MM-DD)
  • %%ISO-TIME%% : current time in ISO-based format (hh:mm:ss)
  • Default (version 1.5.0 and later): Displays the Markdown file name and the date using %%ISO-DATE%%
    "markdown-pdf.headerTemplate": "<div style=\"font-size: 9px; margin-left: 1cm;\"> <span class='title'></span></div> <div style=\"font-size: 9px; margin-left: auto; margin-right: 1cm; \">%%ISO-DATE%%</div>",
  • Default (version 1.4.4 and earlier): Displays the Markdown file name and the date using <span class='date'></span>
    "markdown-pdf.headerTemplate": "<div style=\"font-size: 9px; margin-left: 1cm;\"> <span class='title'></span></div> <div style=\"font-size: 9px; margin-left: auto; margin-right: 1cm; \"> <span class='date'></span></div>",

markdown-pdf.footerTemplate

  • Specifies the HTML template for outputting the footer
  • For more details, refer to markdown-pdf.headerTemplate
  • Default: Displays the {current page number} / {total pages in the document}
    "markdown-pdf.footerTemplate": "<div style=\"font-size: 9px; margin: 0 auto;\"> <span class='pageNumber'></span> / <span class='totalPages'></span></div>",

markdown-pdf.printBackground

  • Print background graphics
  • boolean. Default: true

markdown-pdf.orientation

  • Paper orientation
  • portrait or landscape
  • Default: portrait

markdown-pdf.pageRanges

  • Paper ranges to print, e.g., '1-5, 8, 11-13'
  • Default: all pages
"markdown-pdf.pageRanges": "1,4-",

markdown-pdf.format

  • Paper format
  • Letter, Legal, Tabloid, Ledger, A0, A1, A2, A3, A4, A5, A6
  • Default: A4
"markdown-pdf.format": "A4",

markdown-pdf.width

markdown-pdf.height

  • Paper width / height, accepts values labeled with units(mm, cm, in, px)
  • If it is set, it overrides the markdown-pdf.format option
"markdown-pdf.width": "10cm",
"markdown-pdf.height": "20cm",

markdown-pdf.margin.top

markdown-pdf.margin.bottom

markdown-pdf.margin.right

markdown-pdf.margin.left

  • Paper margins.units(mm, cm, in, px)
"markdown-pdf.margin.top": "1.5cm",
"markdown-pdf.margin.bottom": "1cm",
"markdown-pdf.margin.right": "1cm",
"markdown-pdf.margin.left": "1cm",

PNG, JPEG options

markdown-pdf.quality

  • jpeg only. The quality of the image, between 0-100. Not applicable to png images
"markdown-pdf.quality": 100,

markdown-pdf.clip.x

markdown-pdf.clip.y

markdown-pdf.clip.width

markdown-pdf.clip.height

  • An object which specifies clipping region of the page
  • number
//  x-coordinate of top-left corner of clip area
"markdown-pdf.clip.x": 0,

// y-coordinate of top-left corner of clip area
"markdown-pdf.clip.y": 0,

// width of clipping area
"markdown-pdf.clip.width": 1000,

// height of clipping area
"markdown-pdf.clip.height": 1000,

markdown-pdf.omitBackground

  • Hides default white background and allows capturing screenshots with transparency
  • boolean. Default: false

PlantUML options

markdown-pdf.plantumlOpenMarker

  • Oppening delimiter used for the plantuml parser.
  • Default: @startuml

markdown-pdf.plantumlCloseMarker

  • Closing delimiter used for the plantuml parser.
  • Default: @enduml

markdown-pdf.plantumlServer

markdown-it-include options

markdown-pdf.markdown-it-include.enable

  • Enable markdown-it-include.
  • boolean. Default: true

mermaid options

markdown-pdf.mermaidServer

FAQ

How can I change emoji size ?

  1. Add the following to your stylesheet which was specified in the markdown-pdf.styles
.emoji {
  height: 2em;
}

Auto guess encoding of files

Using files.autoGuessEncoding option of the Visual Studio Code is useful because it automatically guesses the character code. See files.autoGuessEncoding

"files.autoGuessEncoding": true,

Output directory

If you always want to output to the relative path directory from the Markdown file.

For example, to output to the "output" directory in the same directory as the Markdown file, set it as follows.

"markdown-pdf.outputDirectory" : "output",
"markdown-pdf.outputDirectoryRelativePathFile": true,

Page Break

Please use the following to insert a page break.

<div class="page"/>

Known Issues

markdown-pdf.styles option

1.5.0 (2023/09/08)

  • Improve: The default date format for headers and footers has been changed to the ISO-based format (YYYY-MM-DD).
    • Support different date formats in templates #197
  • Improve: Avoid TimeoutError: Navigation timeout of 30000 ms exceeded and TimeoutError: waiting for Page.printToPDF failed: timeout 30000ms exceeded #266
  • Fix: Fix description of outputDirectoryRelativePathFile #238
  • README
    • Add: Specification Changes
    • Fix: Broken link

License

MIT

Special thanks

and

vscode-markdown-pdf's People

Contributors

andre-stoesel avatar cedric-m avatar glenasmith avatar hirschmann avatar jc-nr avatar kororos avatar madacol avatar malys avatar manuth avatar martilidad avatar migrap avatar mtausig avatar poke avatar ppqn-as avatar tigerhawkvok avatar vimtaai avatar yzane avatar zachvalenta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-markdown-pdf's Issues

EACCES: permission denied

I was able to generate a pdf once, but since then I keep getting 2 errors they are EACCES: permission denied, open 'something.pdf' and ERROR: exportPdf(). Obviously, they are related since they both appear every time. There are 2 files I am trying to generate PDFs of one I previously generated but deleted since I needed to change the formatting. I am running vscode version 1.20.0. I tried closing and re-opening vscode to make sure it wasn't a bug with the editor but that did not help.

Relative paths in settings.json?

Before anything else, seriously well done on this project - it's great work!

I just wanted to know if it's possible to have settings.json accept relative paths for the markdown-pdf.styles?

Something like this:
"markdown-pdf.styles": [ ".vscode/md.css" ]

PDF output only contains "undefined"

Hey, I installed your extension into VS Code 1.9.0 on Windows 7.

But when I try to convert a file I only get "undefined" as text in the resulting PDF.
No errors are displayed in either console or developer tools.

Any ideas?

Syntax highlighted with line numbers

Hello,
I am using the plugin and it is very very helpful. Thanks.
I highlighted the syntax with monokai.css theme.

But what I find missing are line numbers in the highlighted code.

Can it be possible to implement this feature?

Can't include images that contains "#" in the local path

Can't include images that contains "#" in the local path.

ex:

sample.md

![IMG](IMG.png)
Result Path
OK D:\CSharp\sample.md
NG D:\C#\sample.md

Markdown PDF 0.1.6

version 1.9.1
commit f9d0c687ff2ea7aabd85fb9a43129117c0ecf519
date 2017-02-09T00:26:45.394Z
shell 1.4.6
render 53.0.2785.143
Node 6.5.0

Exclude default CSS if the `styles` configuration is set

Hi!
It would be nice to disable the default CSS if I'm using my own custom CSS with the markdown-pdf.styles option as the default one can interfere with custom styling.

All you have to do is to make the inclusion of the default CSS dependent of the number of defined custom styles. (Basically move lines 430 and 431 to the else branch of the if on line 435 in extension.js)

filename = path.join(__dirname, 'styles', 'markdown.css');

Proposed code snippet (extension.js)

  // 1. read the style of the markdown.styles setting.
  styles = vscode.workspace.getConfiguration('markdown')['styles'];
  if (styles && Array.isArray(styles) && styles.length > 0) {
    for (i = 0; i < styles.length; i++) {
      var href = filename = styles[i];
      var protocol = url.parse(href).protocol;
      if (protocol === 'http:' || protocol === 'https:') {
        style += '<link rel=\"stylesheet\" href=\"" + href + "\" type=\"text/css\">';
      } else if (protocol === 'file:') {
        style += makeCss(filename);
      }
    }
  } else {
    // 2. read the style of the vscode.
    filename = path.join(__dirname, 'styles', 'markdown.css');
    style += makeCss(filename);
  }

Another option would be to include a markdown-pdf.useDefaultStyle setting.

Relative CSS File paths

I have the markdown file and the css file in the same folder at the same level.

I added the file path to my css as following

{
     "markdown-pdf.breaks": true,
      "markdown-pdf.styles": [
        "E:/MarkDown/vscode/my.css"          // OK
    ]
}

This works but as the path is absolute moving the folder will break css

I also tried to add the following paths

{
     "markdown-pdf.breaks": true,
      "markdown-pdf.styles": [
       ".//my.css"  //DID NOT WORK
       ".\my.css"  //DID NOT WORK
       "my.css"  //DID NOT WORK
    ]
}

I believe this should have worked but did not. Let me know if I am missing anything here.

Image in table not shown in output pdf

The markdown file is like following:

<img src="test.png">

| Image |
| --- |
|<img src="test.png">|

Preview in vscode:
screenshot from 2018-02-10 15-19-47

But in generated pdf, only the first image (outside table) is rendered.
screenshot from 2018-02-10 15-21-48

I'm using vscode 1.19.1 and Markdown PDF 0.1.7.

Any help? Thank you very much!

Replace info messages with statusbar messages.

The extension sends an info message each time it generates a PDF, those are intended for users to do something about them (basically to give users important information).
Since the message sent if it is a successful save is one that really doesn't need the user to do anything, having it be a statusbar message would be much better. (Errors should remain as they are now though).

The reason I mention this is that I save my file quite often, so the info bar often obscures my tabs, making it very annoying.

The font size of final pdf depends on display scaling (win10)

VSCode 1.9.1
markdown-pdf 0.1.6
platform: win10, OS X

I observe too small font in pdf generated on machine with HighDPI display. It would be fine to have some display- and system-independent settings for font size.

How to repoduce (win10)

  1. take arbitrary non-empty .md document
  2. in Preferences/System change magnification ration ("Change the size of text, apps, and other items")
  3. generate pdf in VSCode
  4. repeat 2-3 for different settings
  5. compare pdfs

[BUG] Custom PDF style not being used

Hi,

I am trying to use a custom stylesheet but it does not work as expected. I've saved the CSS into ~.vscode-insiders/markdown-pdf.css and added "markdown-pdf.styles": [".vscode-insiders/markdown-pdf.css"] to my settings. Am I doing something wrong?

Thanks
Peter

Enable glob / regexp filtering or ignore files?

I would like to request the ability to use globbing in the config to exclude other markdown files except the ones the globbing hits.

Alternatively I would be fine with a simple ignore files array inside of the configs. Maybe globbing could be enabled in that ignore later?

Note: This feature would be extremely useful with in conjunction with convertOnSave

I can't style checkboxes

Checkboxes are rendered in the PDF when using "[ ]" string but I can't style them with CSS (it works for headings etc. so the CSS file is found)

I tried the following CSS:

input[type=checkbox] {
border: 1px solid #FA0101;
}
input {
border: 1px solid #3300F7;
}
input:checked {
border: 1px solid #00FF30;
}
[checkbox=unchecked] {
border: 1px solid #F2FF00;
}
[checkbox=checked] {
border: 1px solid #00FBFF;
}

Btw.: is there a way to see the generated HTML to debug such problems?

Phantom js problem on Mac OS

I tried converting a markdown file on Mac OS and got the following information:

ERROR: phantomjs binary does not exist: /Users/Hahaha/.vscode/extensions/yzane.markdown-pdf-0.1.7/node_modules/phantomjs-prebuilt/lib/phantom\bin\phantomjs.exe

Is there something wrong? Or does it only work on Windows?

Define Multiple outputformats

It would be nice if markdown-pdf.type could be a list, to generate PDF & HTML files the same time.

Perhaps somethink like

{
"markdown-pdf.type": "pdf,html",
"markdown-pdf.type": ["pdf","html"],
}

Output file is not created

Although no error message is displayed, the output file is not created because the permission is insufficient.

How do I change the image size in the conversion results?

Thank you for offering such a nice plug-in.
I tried using HTML in my .md file:
<img src="test.png" width="800" height="900" />
The preview results show the picture correctly, in line with my expected size.
In the generated file, the picture was blurry and not clear. I tried to change the .css file, but it didn't work.


Sorry, I'm not good at English. The description is a little confusing, but I really hope to get your help!

After export to pdf, all the HyperLink and A tag were disabled

Thank you very much for your excellent plugin at first!

I wonder if i cause one issue, while finish my markdown doc, i try to export to pdf, but found that all the HyperLink and A tag were disabled. Click it but no work.

If there somewhere i was missing, pls leave me tip, thank you!

Regards,
Marksion

Default pdf output text encoding

Hi,
I'm having problems using vscode with "windows1252" as default files encoding.

Whenever I use accented chars, even if I can see them previewed correctely, they became unknown chars when I try to convert the markdown doc to pdf.

  • here's the screenshot of the editor and the preview:

test_1

test_2

  • and here a screen of the converted pdf:

test_3

Is there a way (maybe some css style file to edit) to change the output encoding so they match?

Images in header

Can't insert image in header or footer. It would be great to implement this feature

how to export pdf with latex

Also I add the js

    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <script type="text/x-mathjax-config">
        MathJax.Hub.Config({ tex2jax: {inlineMath: [['$', '$']]}, messageStyle: "none" });
    </script>

in template.html, can export correct html ,but not pdf

Relative path error of markdown-pdf.styles

An error occurs if css file is specified with relative path in markdown-pdf.styles.

Running the contributed command:'extension.markdown-pdf' failed.

If you convert the markdown file after opening the folder with vscode, no error will occur.

Page number start form a specific page

The footer gives option to set page numbes as shown

"markdown-pdf.footer.contents": "<div style=\"text-align: center; margin-top: 0.5cm;\">{{page}}/{{pages}}</div>"

However the page number starts from the first page, I want to offset it and want the page numbering to begin on the 5th page

Is it possible to add such a feature?

Broken internal links

Hi,
I can't manage to get internal links in the exported PDF, even if they works in VSCode Markdown Preview.

Is there a way to get them working?

I'm using VSCode v1.16.1 in Windows 10 and Markdown PDF v0.1.7

HTML Export with Footer / HEader

This elements do not work for HTML output.
Will there be a change?

"markdown-pdf.footer.contents": "
"markdown-pdf.header.contents":

Is it possible to use in a task runner like gulp?

Hi!
First of all, thank you for the plugin, it's great!
Then I wonder if it would be possible to easily use the tool in a build process, so the file or stream could be used in a different task?

Thank you!

Regards Tim

How to change font size of generated pdf

I have been trying to change the font size. The size was too big. I have tried to change the markdown.preview.fontSize from 14 to 11 but the final pdf is not changed.

I don't see the settings for changing font size in mardown-pdf settings.

Any suggestion ??

Blank spaces where emojis were used.

Hi,
The overall extension works as it should be but notices a small bug when was converting a doc from md. to .pdf.
The issue was that I got blank spaces where ever I used emojis in my markdown file.
Added images for better understanding.


screen shot 2018-02-15 at 5 31 04 pm

👆🏼 content of `markdown` file

screen shot 2018-02-15 at 5 30 44 pm

👆🏼 content of `pdf' file.

Windows-specific path to Phantomjs fails on OS X/*NIX

Markdown PDF fails on OS X becasue the path to Phanotmjs is Windows-specific:

/lib/phantom\bin\phantomjs.exe and switch to *nix-style path

It would be good to make this path adapt to the appropriate location when the extension is installed on OS X/*nix. See #22

ERROR: phantomjs binary does not exist

Trying to generate a pdf, and keep getting this error:
ERROR: phantomjs binary does not exist: C:\Users\user_name\.vscode\extensions\yzane.markdown-pdf-0.1.4\node_modules\phantomjs-pre
I have tried running the command several times, but still keep getting this error.

I can't actually open the .pdf it generates. Please excuse me if its a trivial problem - I am new to using VSC. I also installed Auto-open Markdown packages.

Thanks in advance.

conflict with vscode vim

This is really weird. I'm a vscodevim user. Every time after I installed markdown-pdf the vim extension will stop working. These two extensions cannot run at the same time. If I disable one to use another everything runs fine.

Please let me know if I can provide any other information.

Not correctly rendering Windows 1252 encoding

Not correctly rendering .md documents with Windows 1252 encoding:

For example the following md

abcdefghijklmnopqrstuvwxyz
à ç é è ê û 

exports as :

abcdefghijklmnopqrstuvwxyz 􀀠 􀀠 􀀠 􀀠 􀀠 􀀠

image

btw, thanks for a great tool :)

TOC extension not working on Convert Markdown to PDF

I can't see links working on a generated pdf from markdown to pdf extension. TOC extension is working on default markdown preview on VSCode.

  • VSCode Version: 1.15.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. Write a nice markdown text (with many #, ## and ###)
  2. Enable TOC on Markdown (with Markdown TOC extension)
  3. Convert Markdown to PDF (with Markdown to PDF extension)

If you have any plans to solve this reporting please tell me.

H1 headers not recognized

Hi:

I've been experimenting with this extension and I'm having trouble to generate level 1 headers using the syntax:

# Header content

It simply doesn't recognize it and generates the text as is (with the hash shown) when I convert to PDF using the extension.

Are you experiencing this problem?

Thanks for your work!

Inline code blocks do not use a proportional font

Hello,

Inline code like this do not use a proportional font when converted to PDF, contrary to the markdown preview in VSCode as you can see:
markdown-pdf_inline_code_font

It seems that font-family: inherit in markdown-pdf.css causes the problem:

/* for inline code */
:not(pre):not(.hljs) > code {
	color: #A31515;
	font-size: inherit;
	font-family: inherit; 
}

Multiple Exports Formats?

Hey,

I tried to export a markdown file to pdf and html but it failed with

"markdown-pdf.type": "pdf, html"

Is it somehow possible to achieve this without switching the settings all the time?

Best regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.