Giter Club home page Giter Club logo

markdown-themeable-pdf's Introduction

This project is archived because the owner no longer uses the Atom Editor.

It would be very good to find a new owner for this project, who will take care of updating and expanding the Atom package. A new version based on Chrome Headless has already been prepared in a feature branch.

markdown-themeable-pdf.png

Themeable markdown converter (Print to PDF, HTML, JPEG or PNG)

Version Total Downloads License Dependencies

This Atom package converts / prints / exports your markdown file simple and pretty to PDF, HTML, JPEG or PNG format.

The package was created at the beginning to help in the daily work with manuals for customers. Many people are not familiar with Markdown and they will now receive a well-formatted PDF from their developers. Important here is that the document looks good and professional. This Atom package tries to ask about this task.

Installation

Search in atom under Settings View -> Install -> Packages the package markdown-themeable-pdf and start the installation.

Usage

The PDF can be generated in various ways:

  • Right-click in the editor area when a file is opened and select Markdown to PDF or
  • Right-click on a markdown file in Tree-View and select Markdown to PDF or
  • Press ctrl-shift-E (E = Export) in the editor area when a file is opened

Page breaks

You can start any time a new PDF page with typing Snippet/Shortcode page-break in your markdown editor. So you can prevent such ugly breaks in lists or other contiguous areas.

Custom CSS

The package creates a CSS file ~/.atom/markdown-themeable-pdf/styles.css in your atom configuration directory. You can use this file to customize everything. If you want to change the path, you can change it in the package settings. Alternatively, you can define with project-path/markdown-themeable-pdf/styles.css for each project its own CSS.

Tip: Export your markdown as HTML to inspect it in your favorite browser. After CSS changes you must not restart atom.

Custom header & Custom footer

The pdf document can be decorated with your own header and footer. This can be flexibly adapted to JavaScript files. Each of these files represents a node.js module, which returns an object with two required properties height and contents. After you have made any changes you need to reload or restart atom.

To customize the document header, open ~/.atom/markdown-themeable-pdf/header.js (you can change this path in the package settings) and change it to your needs:

// EXAMPLE
module.exports = function () {
    return {
        height: '2cm',
        contents: '<div style="text-align: right;"><span>Created by</span> <img src="logo.png" alt="Logo" /> <span style="color: #EC4634; font-size: 120%; text-transform: uppercase;">markdown-themeable-pdf</span></div>'
    };
};

To customize the document footer, open ~/.atom/markdown-themeable-pdf/footer.js (you can change this path in the package settings) and change it to your needs:

// EXAMPLE
module.exports = function () {
    var dateFormat = function () {
        return (new Date()).toLocaleDateString('en-US', {
            weekday: 'long',
            year: 'numeric',
            month: 'short',
            day: 'numeric',
            hour: '2-digit',
            minute: '2-digit'
        });
    };
    return {
        height: '1cm',
        contents: '<div style="float:left;">Page {{page}}/{{pages}}</div><div style="float:right;">&copy; Copyright ' + dateFormat() + ' by COMPANYNAME</div>'
    };
};

Tip: Alternatively, you can define with project-path/markdown-themeable-pdf/header.js or project-path/markdown-themeable-pdf/footer.js for each project its own header and footer.

Example / Demo

See Demo.pdf - the PDF version of Demo.md.

DEMO

Todo

  • Fix: Open Markdown Preview with ctrl-shift-M, right-click in markdown-preview area and select Save As PDF
  • Better handling of long code lines
  • Font Awesome integration
  • Emojis
  • Inline Links (Anchors)

Known Issues

  • Table header glitches when a table starts directly on a new page

    When that happens, you can put in your markdown in front of the table an html code <div class="page-break" /> to prevent this.

Credits

Special thanks to ...

markdown-themeable-pdf's People

Contributors

cakebake avatar harmsk avatar tlhunter 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

markdown-themeable-pdf's Issues

Bullet formatting - markdown taken from GitLab

Hello there,

I noticed that some bullet point levels are missing when I create a PDF with this package.

The source MD comes from Atom and has been optimized to render in GitLab's editor (which has some known quirks with bullet points).

Is there a recommendation on syntax to make bullets "just work" in a minimal way with markdown-themeable-pdf?

Feature Request: Optional specified output path

It would be nice to have settings option to specify output path to somewhere other than the directory of the input file.

For example, if the default is $INPUT_FILE_PATH$/$INPUT_FILE_NAME$.pdf allow alternatives like $INPUT_FILE_PATH$/pdf/$INPUT_FILE_NAME$.pdf or ~/some/other/path/$INPUT_FILE_NAME$.pdf

Cannot find module 'ncp'

After I install your module, atom throws an error claiming it cannot find the module 'ncp'. I had to install your module by downloading the git repo and manually placing it in my packages folder as I am behind a firewall at work and cannot install anything directly through atom.

Here is How I produced the error:

  1. Manually place markdown-themable-pdf-master folder in packages folder of atom
  2. Open Atom
  3. Error thrown

Atom Version: 1.0.13
System: Microsoft Windows 7 Professional
Thrown From: markdown-themeable-pdf package, v0.9.0

Stack Trace

Failed to activate the markdown-themeable-pdf package

At Cannot find module 'ncp'

Error: Cannot find module 'ncp'
    at Module._resolveFilename (module.js:334:15)
    at Function.Module._resolveFilename (C:\Users\rr146019\AppData\Local\atom\app-1.0.13\resources\app.asar\src\module-cache.js:383:52)
    at Function.Module._load (module.js:284:25)
    at Module.require (module.js:363:17)
    at require (module.js:382:17)
    at Object.module.exports.markdownThemeablePdf.activate (C:\Users\rr146019\.atom\packages\markdown-themeable-pdf-master\lib\markdown-themeable-pdf.js:184:19)
    at Package.module.exports.Package.activateNow (C:\Users\rr146019\AppData\Local\atom\app-1.0.13\resources\app.asar\src\package.js:245:19)
    at C:\Users\rr146019\AppData\Local\atom\app-1.0.13\resources\app.asar\src\package.js:226:30
    at Package.module.exports.Package.measure (C:\Users\rr146019\AppData\Local\atom\app-1.0.13\resources\app.asar\src\package.js:169:15)
    at Package.module.exports.Package.activate (C:\Users\rr146019\AppData\Local\atom\app-1.0.13\resources\app.asar\src\package.js:218:14)

Commands

Config

{
  "core": {
    "themes": [
      "one-dark-ui",
      "solarized-dark-syntax"
    ],
    "followSymlinks": true
  }
}

Installed Packages

User

  • language-csharp
  • language-vb
  • markdown-pdf
  • markdown-themable-pdf
  • node-html-pdf

Dev

No dev packages

PDF optimization / compression possible

Any thoughts about optimization / compression for PDFs? I'm writing some documents that are 15-40 pages in length and the resulting PDFs are starting to be quite large (order of 10MB on the lower end). I've not inspected the resulting PDFs too closely, but the same HTML output is approximately 30KB. Perhaps this has to do with extra included styling? Running Atom on OS X right now.

Uncaught TypeError: Parameter 'url' must be a string, not undefined

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.19
System: Mac OS X 10.11
Thrown From: markdown-themeable-pdf package, v0.10.1

Stack Trace

Uncaught TypeError: Parameter 'url' must be a string, not undefined

At /Users/remo/.atom/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:335

TypeError: Parameter 'url' must be a string, not undefined
  at Url.parse (url.js:90:11)
  at Object.urlParse [as parse] (url.js:84:5)
  at Object.module.exports.markdownThemeablePdf.resolveImgSrc (/Users/remo/.atom/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:524:17)
  at Object.<anonymous> (/Users/remo/.atom/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:298:63)
  at [object Object].exports.each (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/cheerio/lib/api/traversing.js:267:24)
  at Object.md.renderer.rules.html_block (/Users/remo/.atom/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:297:26)
  at Renderer.render (/Users/remo/.atom/packages/markdown-preview-plus/node_modules/markdown-it/lib/renderer.js:292:38)
  at MarkdownIt.render (/Users/remo/.atom/packages/markdown-preview-plus/node_modules/markdown-it/lib/index.js:513:24)
  at /Users/remo/.atom/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:333:31
  at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
  at EventEmitter.ipc.sendSync (/Applications/Atom.app/Contents/Resources/atom.asar/renderer/api/lib/ipc.js:21:31)
  at BrowserWindow.RemoteMemberFunction [as emit] (/Applications/Atom.app/Contents/Resources/atom.asar/renderer/api/lib/remote.js:140:29)
  at ContextMenuManager.module.exports.ContextMenuManager.showForEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/context-menu-manager.js:170:31)
  at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:157:33)
  at HTMLDocument.handler (/Applications/Atom.app/Contents/Resources/app.asar/src/space-pen-extensions.js:112:34)
  at HTMLDocument.jQuery.event.dispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/space-pen/vendor/jquery.js:4681:9)
  at HTMLDocument.elemData.handle (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/space-pen/vendor/jquery.js:4359:46)

Commands

     -9:35.8.0 application:minimize (div.settings-view.pane-item)
     -9:22.5.0 markdown-katex-preview:toggle (atom-text-editor.editor.vim-mode.normal-mode.is-focused)
     -8:46.3.0 markdown-preview:toggle (atom-text-editor.editor.vim-mode.normal-mode.is-focused)
     -8:19.6.0 markdown-preview-plus:toggle-render-latex (div.markdown-preview.native-key-bindings)
     -8:09.4.0 markdown-pdf:convert (atom-text-editor.editor.vim-mode.normal-mode.is-focused)
  3x -8:02.9.0 markdown-preview-plus:toggle (atom-text-editor.editor.vim-mode.normal-mode.is-focused)
     -3:16.9.0 settings-view:install-packages-and-themes (atom-text-editor.editor.vim-mode.normal-mode.is-focused)
  2x -1:56.2.0 markdown-themeable-pdf:export (atom-text-editor.editor.vim-mode.normal-mode.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "markdown-preview"
    ]
  },
  "markdown-themeable-pdf": {}
}

Installed Packages

# User
add-line-break, v0.2.0
ascii-codes, v0.3.3
asciidoc-preview, v0.6.0
atom-markdown-katex, v0.3.7
color-picker, v2.0.11
language-asciidoc, v0.11.1
markdown-deluxe, v1.0.0
markdown-pdf, v1.3.9
markdown-preview-plus, v2.2.2
markdown-preview-plus-opener, v0.2.0
markdown-themeable-pdf, v0.10.1
vim-mode, v0.58.0
vim-mode-visual-block, v0.2.13
wrap, v0.1.0

# Dev
No dev packages

image not showing up in pdf

I insert an image in md.

![](serious/roc.png)

(No embedded spaces in the filename.)

It doesn't show up in the pdf. (It does show up in "markdown-preview" and It does work with "markdown-pdf" plugin.)

LaTeX

Would be nice to have latex support.

Uncaught TypeError: Cannot read property 'stream' of undefined

[Enter steps to reproduce below:]

  1. Use the package

Atom Version: 1.0.7
System: Windows Version 7 Home Premium
Thrown From: markdown-themeable-pdf package, v0.2.0

Stack Trace

Uncaught TypeError: Cannot read property 'stream' of undefined

At C:\Users\Florian\.atom\packages\markdown-themeable-pdf\lib\markdown-themeable-pdf.js:85

TypeError: Cannot read property 'stream' of undefined
    at C:\Users\Florian\.atom\packages\markdown-themeable-pdf\lib\markdown-themeable-pdf.js:85:24
    at C:\Users\Florian\.atom\packages\markdown-themeable-pdf\node_modules\phantom-html-to-pdf\lib\phantomWebServerStrategy.js:38:24
    at C:\Users\Florian\.atom\packages\markdown-themeable-pdf\node_modules\phantom-html-to-pdf\node_modules\phantom-workers\lib\phantomManager.js:90:13
    at C:\Users\Florian\.atom\packages\markdown-themeable-pdf\node_modules\phantom-html-to-pdf\node_modules\phantom-workers\lib\phantomWorker.js:92:20
    at Socket.<anonymous> (C:\Users\Florian\.atom\packages\markdown-themeable-pdf\node_modules\phantom-html-to-pdf\node_modules\phantom-workers\lib\checkPortStatus.js:45:9)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:166:7)
    at TCP.close (net.js:464:12)

Commands

  3x -3:07.5.0 markdown-themeable-pdf:export (atom-text-editor.editor.is-focused)
     -2:58.3.0 command-palette:toggle (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "minimap-git-diff",
      "markdown-table-formatter",
      "autocomplete-ruby",
      "atomatigit",
      "git-go",
      "language-diff"
    ],
    "projectHome": "E:\\Documents personnels\\Informatique\\"
  }
}

Installed Packages

# User
atom-html-preview, v0.1.11
autohide-tree-view, v0.24.0
color-picker, v2.0.11
highlight-selected, v0.10.1
linter, v1.4.3
linter-csslint, v1.0.5
linter-htmlhint, v0.1.1
linter-less, v2.0.3
linter-ruby, v1.0.1
markdown-mindmap, v0.2.2
markdown-themeable-pdf, v0.2.0
minimap, v4.12.3
minimap-autohide, v0.10.1
minimap-find-and-replace, v4.3.0
minimap-linter, v1.0.0
pdf-view, v0.23.0
ruby-block, v0.3.5
seti-icons, v0.4.2
Sublime-Style-Column-Selection, v1.3.0
tree-view-git-status, v0.1.2

# Dev
No dev packages

I got this problem even after rebooting my PC since the last update, but it doesn't appear on my Debian virtual machine, the package is working fine and as expected on the VM.

could not install this package from atom

I can not download this package from atom and it seems that I could not connect to the server in atom. Strangely, the "markdown-themeable-pdf" website can be opened in Chrome, is there any help?

1 bug and 1 suggestion

Hi !

First of all, thank you for this cool package, it works well on the majority of my markdown files ^^

But I got a problem with one of them : it's so huge that I use some huge comments to navigate in it via the minimap. Only this kind of comments are just stopping the PDF conversion (short comments doesn't stop the conversion : <!-- TOC depth:6 withLinks:1 updateOnSave:1 orderedList:1 --> )
And here is an example of a file which won't be completed as PDF because of the "PREZ" comment : http://pastebin.com/kVpRWnFj

Finally, I got 1 suggestion to enhance your package : the support of local images, it would be cool :D

No PNG pictures in PDF or HTML exports

Hi cakebake!
I like the idea of your plug-in "markdown-themeable-pdf".
Unfortunately it does not include PNG pictures neither into PDF export, nor in HTML exports. This is a real pitty, because I am using these picture format all day long.
Is this a "not-yet-implemented-feature" or a "little-tiny-bug"?

Nevertheless.
I have to write it in capital letters: COOL TOOL! +1

image is on two pages

Maybe not a bug, but not a desired result either. I have a big image. This is image is stretched across two pages. Somehow it should be scaled down to fit one page ?

Question: Filename to header/footer?

Is it possible, to automatically add the filename of the markdown-file to the pdf-header or pdf-footer?
If so, what would the Javascript-Code for header.js would look like?

Thanks a lot for your extension! :-)

Set Background-Color over full Page

Hi,

I'm currently trying to set the background-color over the full page of a pdf-export.
i try to declare the background-color in css as followed:

html {
    background-color: #263238;
    /*padding: 20px;*/
}

Or

body {
    background-color: #263238;
}

but the result shows, that there is a white border around the content of the page.
tmp_issue

Is it possible to set the "Page-color"?

table header collision

Tables over multiple pages in PDF export mode has colliding header with first row after page-break inside table.
page-break

html tags disables markdown formatting

Hi!

When I try to convert a markdown that uses html tags to format some lines (centering them for example) it ignores the markdown formatting and just considers everything inside as regular text.
Kindly see below some code example and the output.

Code:
image

PDF:
image

I've tried searching for other ways to center lines but using html tags is what everyone recommends. Can this be integrated in the package? :)

Cheers,
irene

Uncaught Error: 2015-10-20T13:40:17 [CRITICAL] QWin32PrintEngine::initialize: OpenPrinter failed ...

  1. Set export to pdf
  2. Open markdown file
  3. run export command form commands palete

Image and html export works fine.

Atom Version: 1.0.19
System: Microsoft Windows 10 Pro
Thrown From: markdown-themeable-pdf package, v0.10.1

Stack Trace

Uncaught Error: 2015-10-20T13:40:17 [CRITICAL] QWin32PrintEngine::initialize: OpenPrinter failed (Serwer RPC jest niedost?pny.)
2015-10-20T13:40:17 [CRITICAL] QWin32PrintEngine::initialize: OpenPrinter failed (Serwer RPC jest niedost?pny.)

At C:\Users\Kamil\.atom\packages\markdown-themeable-pdf\lib\markdown-themeable-pdf.js:458

Error: 2015-10-20T13:40:17 [CRITICAL] QWin32PrintEngine::initialize: OpenPrinter failed (Serwer RPC jest niedost?pny.)
2015-10-20T13:40:17 [CRITICAL] QWin32PrintEngine::initialize: OpenPrinter failed (Serwer RPC jest niedost?pny.)

  at ChildProcess.<anonymous> (C:\Users\Kamil\.atom\packages\markdown-themeable-pdf\node_modules\html-pdf\lib\pdf.js:123:17)
  at emitTwo (events.js:87:13)
  at ChildProcess.emit (events.js:172:7)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

Commands

     -3:05.5.0 command-palette:toggle (atom-text-editor.editor.is-focused)
     -3:01.6.0 core:move-down (atom-text-editor.editor.mini.is-focused)
     -3:01.0 core:move-up (atom-text-editor.editor.mini.is-focused)
     -2:55.7.0 command-palette:toggle (atom-text-editor.editor.is-focused)
  3x -2:52.4.0 core:move-down (atom-text-editor.editor.mini.is-focused)
     -2:51.6.0 core:move-up (atom-text-editor.editor.mini.is-focused)
     -2:44.3.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -2:44.3.0 core:cancel (atom-text-editor.editor.mini.is-focused)
     -2:40.4.0 core:save (atom-text-editor.editor.is-focused)
     -2:39.4.0 command-palette:toggle (atom-text-editor.editor.is-focused)
  3x -2:37.4.0 core:move-down (atom-text-editor.editor.mini.is-focused)
     -2:36.7.0 core:move-up (atom-text-editor.editor.mini.is-focused)
     -2:36 core:confirm (atom-text-editor.editor.mini.is-focused)
     -2:36 markdown-themeable-pdf:export (atom-text-editor.editor)
     -2:21.2.0 settings-view:open (atom-text-editor.editor)
  4x -2:14.2.0 markdown-themeable-pdf:export (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "one-dark-ui",
      "monokai-syntax-for-one-dark"
    ],
    "autoHideMenuBar": true,
    "disabledPackages": [
      "release-notes",
      "autoclose-html",
      "Zen",
      "build-tools",
      "emmet"
    ]
  },
  "markdown-themeable-pdf": {
    "openPdfInAtomWorkspace": false
  }
}

Installed Packages

# User
atom-beautify, v0.28.14
atom-django, v0.3.0
atom-html-preview, v0.1.11
atom-minify, v0.4.2
autocomplete-paths, v1.0.2
autocomplete-plus-python-jedi, v0.3.6
autocomplete-python, v0.6.2
bookmarks, v0.38.0
coffee-compile, v0.19.1
color-picker, v2.0.13
deprecation-cop, v0.54.0
file-type-icons, v0.7.3
flex-tool-bar, v0.5.0
imdone-atom, v1.1.45
incompatible-packages, v0.25.0
indent-guide-improved, v1.4.3
keyboard-localization, v1.4.9
language-aspx, v0.4.0
language-batch, v0.3.3
language-gfm, v0.81.0
language-go, v0.39.0
language-mustache, v0.13.0
language-objective-c, v0.15.0
language-powershell, v2.1.0
language-ruby, v0.60.0
language-ruby-on-rails, v0.23.0
language-yaml, v0.24.0
linter, v1.8.1
linter-bootlint, v0.0.6
linter-coffeescript, v1.0.0
linter-csslint, v1.1.0
linter-jshint, v1.2.1
linter-pep8, v1.0.1
markdown-themeable-pdf, v0.10.1
metrics, v0.52.0
minimap, v4.13.4
minimap-linter, v1.0.0
monokai-syntax-for-one-dark, v0.2.2
pigments, v0.15.0
project-manager, v2.6.1
Sublime-Style-Column-Selection, v1.3.0
sync-settings, v0.6.0
tabs-to-spaces, v0.11.1
tool-bar, v0.1.9
webbox-color, v0.5.8
welcome, v0.30.0

# Dev
No dev packages

styles.css project specific ignored

My obiective is create a custom styles.css for my markdown book project.

  1. I have create the directory markdown-themeable-pdf
  2. generated a styles.css into markdown-themeable-pdf dir
  3. generate pdf (ctrl-shif-e)

But the generated pdf haven't any of my custom

OS: Macosx 10.9.5
Atom: 1.5.4

image not showing up in pdf.

I insert an image in md.

![](screendumpd/normally closed.png)

It doesn't show up in the pdf. (It does show up in "markdown-preview" and It does work with "markdown-pdf" plugin.)

Links are not converted correctly

I have a Link like this:
[Google Maps Time Zone API](https://developers.google.com/maps/documentation/timezone/intro)

The specs say this is a correct link, but the converter (to pdf) outputs the text and then the link instead.

If helpful:
I use the link within a nested list

I use version 0.10.1

Pictures won't load / are not included in exported PDF

Hello
I trying to convert a Markdown with images into a PDF and also included an image in the header.js but it won't load the picture.
The Text converts fine but no pictures.
It worked till the last update...

I tried moving the pictures to the 'markdown-themeable-pdf' folder in .atom and in my project-folder everywhere they won't show up

Uncaught Error: html-pdf: PDF generation timeout. Phantom.js script did not exit.

Hi when trying to generate pdf from markdown, this error often occurs:

Atom Version: 1.5.4
System: Mac OS X 10.10.5
Thrown From: markdown-themeable-pdf package, v0.10.2

Stack Trace

Uncaught Error: html-pdf: PDF generation timeout. Phantom.js script did not exit.

At /Users/chrishu/.atom/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:470

Error: html-pdf: PDF generation timeout. Phantom.js script did not exit.
    at ChildProcess.<anonymous> (/Users/chrishu/.atom/packages/markdown-themeable-pdf/node_modules/html-pdf/lib/pdf.js:111:17)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

Commands

     -1:39.1.0 command-palette:toggle (atom-text-editor.editor.vim-mode.normal-mode.is-focused)
     -1:36.7.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -1:36.7.0 core:cancel (atom-text-editor.editor.mini.is-focused)
     -1:31.2.0 markdown-preview:toggle (atom-text-editor.editor.vim-mode.normal-mode.is-focused)
     -1:27.7.0 core:close (div.markdown-preview.native-key-bindings)
     -1:25.7.0 command-palette:toggle (atom-text-editor.editor.vim-mode.normal-mode.is-focused)
  4x -1:23.9.0 core:move-down (atom-text-editor.editor.mini.is-focused)
     -1:22.6.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -1:22.6.0 markdown-themeable-pdf:export (atom-text-editor.editor.vim-mode.normal-mode)
     -0:42.3.0 command-palette:toggle (atom-text-editor.editor.vim-mode.normal-mode.is-focused)
     -0:41 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -0:41 core:cancel (atom-text-editor.editor.mini.is-focused)
     -0:36.3.0 command-palette:toggle (atom-text-editor.editor.vim-mode.normal-mode.is-focused)
  4x -0:34.2.0 core:move-down (atom-text-editor.editor.mini.is-focused)
     -0:32.4.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:32.4.0 markdown-themeable-pdf:export (atom-text-editor.editor.vim-mode.normal-mode)

Config

{
  "core": {
    "themes": [
      "one-light-ui",
      "solarized-light-syntax"
    ]
  },
  "markdown-themeable-pdf": {
    "enableCustomFooter": false,
    "enableCustomHeader": false
  }
}

Best wishes : )

Ancor link not rendered

Ancor link (link to title for example) like those generated with TOC are not rendered.

Ex : [But](#but)

Just for info markdown-pdf does it well if you want to check their code.

Uncaught Error: 2015-11-20T11:17:38 [CRITICAL] QWin32PrintEngine::initialize: OpenPrinter failed ...

[Enter steps to reproduce below:]

NOTE: yesterday on Windows 10 before upgrade to Windows 10 1511 Build 10586 was working fine.

  1. Open an .md file.
  2. Right-click and select Markdown to PDF.
  3. And then I get a red floating message with the text below.
  4. Thank you in advance for helping.

Atom Version: 1.2.3
System: Microsoft Windows 10 Pro
Thrown From: markdown-themeable-pdf package, v0.10.1

Stack Trace

Uncaught Error: 2015-11-20T11:17:38 [CRITICAL] QWin32PrintEngine::initialize: OpenPrinter failed (The printer name is invalid.)
2015-11-20T11:17:38 [CRITICAL] QWin32PrintEngine::initialize: OpenPrinter failed (The printer name is invalid.)

At C:\Users\Nuno Rodrigues\.atom\packages\markdown-themeable-pdf\lib\markdown-themeable-pdf.js:458

Error: 2015-11-20T11:17:38 [CRITICAL] QWin32PrintEngine::initialize: OpenPrinter failed (The printer name is invalid.)
2015-11-20T11:17:38 [CRITICAL] QWin32PrintEngine::initialize: OpenPrinter failed (The printer name is invalid.)

    at ChildProcess.<anonymous> (C:\Users\Nuno Rodrigues\.atom\packages\markdown-themeable-pdf\node_modules\html-pdf\lib\pdf.js:123:17)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

Commands

     -2:22.3.0 markdown-preview:toggle (atom-text-editor.editor.is-focused)
     -1:32.2.0 pane:split-left (div.markdown-preview.native-key-bindings)
  3x -0:54.9.0 markdown-preview:toggle (div.markdown-preview.native-key-bindings)
     -0:03.8.0 markdown-themeable-pdf:export (atom-text-editor.editor.is-focused)

Config

{
  "core": {},
  "markdown-themeable-pdf": {
    "openPdfInAtomWorkspace": false,
    "enableBreaks": true
  }
}

Installed Packages

# User
markdown-preview-opener, v0.1.1
markdown-scroll-sync, v0.4.2
markdown-themeable-pdf, v0.10.1

# Dev
No dev packages

Uncaught TypeError: htmlToPdf.create(...).toStream is not a function

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.19
System: Ubuntu 14.04.3
Thrown From: markdown-themeable-pdf package, v0.10.1

Stack Trace

Uncaught TypeError: htmlToPdf.create(...).toStream is not a function

At /home/ivomarsan/.atom/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:455

TypeError: htmlToPdf.create(...).toStream is not a function
  at /home/ivomarsan/.atom/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:455:20
  at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)

Commands

  2x -7:02.2.0 core:save (atom-text-editor.editor.is-focused)
     -7:00.6.0 pane:show-previous-item (atom-text-editor.editor.is-focused)
  8x -6:59.5.0 markdown-pdf:convert (atom-text-editor.editor.is-focused)
  3x -6:54.6.0 core:select-up (atom-text-editor.editor.is-focused)
     -6:54 editor:select-to-end-of-line (atom-text-editor.editor.is-focused)
     -6:53.7.0 core:backspace (atom-text-editor.editor.is-focused)
  2x -6:53.3.0 core:save (atom-text-editor.editor.is-focused)
  3x -6:52.5.0 core:close (atom-text-editor.editor.is-focused)
     -6:26.4.0 core:confirm (atom-text-editor.editor.mini.is-focused)
  6x -6:17.7.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -6:13.8.0 core:confirm (atom-text-editor.editor.mini.is-focused)
  2x -5:23.3.0 markdown-themeable-pdf:export (atom-text-editor.editor.is-focused)
  2x -2:21.3.0 markdown-preview-plus:toggle-render-latex (atom-text-editor.editor.is-focused)
  2x -2:18.1.0 markdown-preview-plus:toggle (atom-text-editor.editor.is-focused)
     -0:24.7.0 pane:show-previous-item (button.btn.btn-default.icon.icon-link)
  2x -0:24.1.0 markdown-preview-plus:toggle (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "autoHideMenuBar": true,
    "disabledPackages": [
      "markdown-preview"
    ]
  },
  "markdown-themeable-pdf": {}
}

Installed Packages

# User
atom-html-preview, v0.1.12
autocomplete-emojis, v2.2.2
file-icons, v1.6.11
linter, v1.10.0
markdown-preview-plus, v2.2.2
markdown-themeable-pdf, v0.10.1
mathjax-wrapper, v0.1.0
minimap, v4.16.0
pigments, v0.18.1
save-session, v0.15.7
selector-to-tag, v0.4.1
tree-view-git-status, v0.2.2

# Dev
No dev packages

I need help

Uncaught TypeError: Cannot read property 'html' of undefined

[Enter steps to reproduce below:]

  1. Create or Open a Markdown File
  2. Press Ctrl+Shift+E
  3. Error message appears (see below)

Atom Version: 1.0.19
System: Ubuntu 14.04.3
Thrown From: markdown-themeable-pdf package, v0.10.0

Stack Trace

Uncaught TypeError: Cannot read property 'html' of undefined

At /home/alex/.atom/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:417

TypeError: Cannot read property 'html' of undefined
  at /home/alex/.atom/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:417:42
  at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)

Commands

     -1:24.6.0 core:select-all (atom-text-editor#markdown-themeable-pdf.customStylesPath.editor.mini.is-focused)
     -1:24.3.0 core:copy (atom-text-editor#markdown-themeable-pdf.customStylesPath.editor.mini.is-focused)
  2x -1:23.6.0 core:paste (atom-text-editor#markdown-themeable-pdf.customHeaderPath.editor.mini.is-focused)
     -0:00.8.0 markdown-themeable-pdf:export (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "markdown-format",
      "tidy-markdown",
      "markdown-pdf"
    ]
  },
  "markdown-themeable-pdf": {
    "customStylesPath": "/home/alex/.atom/markdown-themeable-pdf/",
    "customHeaderPath": "/home/alex/.atom/markdown-themeable-pdf/",
    "customFooterPath": "/home/alex/.atom/markdown-themeable-pdf/"
  }
}

Installed Packages

# User
markdown-preview-opener, v0.1.1
markdown-preview-plus, v2.2.0
markdown-themeable-pdf, v0.10.0

# Dev
No dev packages

Uncaught TypeError: Path must be a string. Received undefined

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.5.4
System: Mac OS X 10.11
Thrown From: markdown-themeable-pdf package, v0.10.2

Stack Trace

Uncaught TypeError: Path must be a string. Received undefined

At path.js:8

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:8:11)
    at Object.posix.join (path.js:477:5)
    at Object.module.exports.markdownThemeablePdf.getConfigFilePath (/Users/Allen/.atom/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:549:28)
    at /Users/Allen/.atom/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:346:44
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)

Commands

  2x -1:09.8.0 advanced-open-file:move-cursor-down (atom-text-editor.path-input.editor.mini.is-focused)
     -1:00.9.0 core:confirm (atom-text-editor.path-input.editor.mini.is-focused)
     -0:55.2.0 pane:split-right (div.pdf-view)
     -0:41.3.0 advanced-open-file:toggle (div.pdf-view)
  6x -0:38.6.0 advanced-open-file:autocomplete (atom-text-editor.path-input.editor.mini.is-focused)
     -0:32.3.0 core:confirm (atom-text-editor.path-input.editor.mini.is-focused)
  3x -0:31.1.0 advanced-open-file:move-cursor-down (atom-text-editor.path-input.editor.mini.is-focused)
     -0:30.3.0 core:confirm (atom-text-editor.path-input.editor.mini.is-focused)
     -0:24.3.0 command-palette:toggle (atom-text-editor.editor.is-focused)
  2x -0:11.7.0 core:move-down (atom-text-editor.editor.mini.is-focused)
     -0:11.3.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:11.3.0 markdown-preview-plus:toggle (atom-text-editor.editor)
     -0:06.9.0 command-palette:toggle (atom-text-editor.editor.is-focused)
  3x -0:04.4.0 core:move-down (atom-text-editor.editor.mini.is-focused)
     -0:02.4.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:02.4.0 markdown-themeable-pdf:export (atom-text-editor.editor)

Config

{
  "core": {
    "closeEmptyWindows": false,
    "packagesWithKeymapsDisabled": [
      "git-control"
    ],
    "themes": [
      "nucleus-dark-ui",
      "one-dark-syntax"
    ]
  },
  "markdown-themeable-pdf": {
    "codeHighlightingTheme": "atelier-cave-dark.css",
    "enableCustomFooter": false,
    "enableCustomHeader": false
  }
}

Installed Packages

# User
advanced-open-file, v0.14.2
color-picker, v2.1.1
emmet, v2.4.1
file-icons, v1.6.17
jshint, v1.8.3
language-latex, v0.6.1
language-matlab, v0.2.0
latexer, v0.3.0
markdown-preview-plus, v2.2.2
markdown-themeable-pdf, v0.10.2
minimap, v4.19.0
minimap-cursorline, v0.1.0
nucleus-dark-ui, v0.7.10
pdf-view, v0.45.0
pigments, v0.24.2
react, v0.14.1
react-snippets, v0.3.0

# Dev
No dev packages

Searchable PDF

Hi Jens, love your package. However, I am missing the possibility to search/highlight in the PDF. Its just created as an image atm. I am on OS X 10.11.2.

Cheers,
Philip

No header, am I missing something?

I did a conversion from MD to PDF after this package installation, there wasn't any header or footer generated, even though header.js and footer.js were there, am I missing something?

monospace font for code

Hello and thanks for this great module
I have one issue really important for me, code blocks are not rendering into monospaced font in pdf export.
it's working for preview but not for pdf export, is it a bug just for me ? how can i try to fix that ?

thanks

Uncaught AssertionError: html-pdf: Failed to load PhantomJS module. You have to set the path to t...

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.19
System: Microsoft Windows 7 Enterprise
Thrown From: markdown-themeable-pdf package, v0.10.1

Stack Trace

Uncaught AssertionError: html-pdf: Failed to load PhantomJS module. You have to set the path to the PhantomJS binary using 'options.phantomPath'

At assert.js:89

AssertionError: html-pdf: Failed to load PhantomJS module. You have to set the path to the PhantomJS binary using 'options.phantomPath'
  at new PDF (C:\Users\bdevries\.atom\packages\markdown-themeable-pdf\node_modules\html-pdf\lib\pdf.js:41:7)
  at Object.exports.create (C:\Users\bdevries\.atom\packages\markdown-themeable-pdf\node_modules\html-pdf\lib\index.js:13:14)
  at C:\Users\bdevries\.atom\packages\markdown-themeable-pdf\lib\markdown-themeable-pdf.js:447:27
  at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)

Commands

  2x -8:26.7.0 core:move-left (atom-text-editor.editor.is-focused)
  5x -8:22.1.0 core:backspace (atom-text-editor.editor.is-focused)
  3x -7:24.4.0 core:move-down (atom-text-editor.editor.is-focused)
 11x -7:09.9.0 core:backspace (atom-text-editor.editor.is-focused)
  2x -6:51.3.0 core:move-down (atom-text-editor.editor.is-focused)
  9x -6:43.8.0 core:backspace (atom-text-editor.editor.is-focused)
  5x -6:01.5.0 core:move-up (atom-text-editor.editor.is-focused)
  2x -6:00.5.0 core:move-down (atom-text-editor.editor.is-focused)
     -5:59.7.0 core:move-right (atom-text-editor.editor.is-focused)
     -5:59.1.0 core:move-up (atom-text-editor.editor.is-focused)
 21x -5:58.8.0 core:move-right (atom-text-editor.editor.is-focused)
     -5:53.4.0 core:backspace (atom-text-editor.editor.is-focused)
  9x -5:52.9.0 core:move-left (atom-text-editor.editor.is-focused)
     -5:50.7.0 core:backspace (atom-text-editor.editor.is-focused)
     -4:32.8.0 settings-view:install-packages-and-themes (atom-text-editor.editor.is-focused)
     -4:20.2.0 core:confirm (atom-text-editor.editor.mini.is-focused)

Config

{
  "core": {
    "themes": [
      "spacegray-mocha-ui",
      "atom-light-syntax"
    ],
    "disabledPackages": [
      "language-gfm"
    ]
  }
}

Installed Packages

# User
language-ipynb, v1.3.0
markdown-themeable-pdf, v0.10.1
spacegray-mocha-ui, v0.2.0

# Dev
No dev packages

Uncaught TypeError: undefined is not a function

[Enter steps to reproduce below:]

  1. Open a markdown file
  2. Press CTRL+SHIFT+E to export

Right clicking in markdown preview also does nothing.

Atom Version: 1.0.9
System: Microsoft Windows 7 Professional
Thrown From: markdown-themeable-pdf package, v0.7.2

Stack Trace

Uncaught TypeError: undefined is not a function

At C:\Users\marty\.atom\packages\markdown-themeable-pdf\lib\markdown-themeable-pdf.js:304

TypeError: undefined is not a function
  at C:\Users\marty\.atom\packages\markdown-themeable-pdf\lib\markdown-themeable-pdf.js:304:20
  at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:379:3)

Commands

     -1:01.1.0 markdown-themeable-pdf:export (atom-text-editor.editor.is-focused)
     -0:41 markdown-preview:toggle (atom-text-editor.editor.is-focused)
     -0:07.3.0 markdown-themeable-pdf:export (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ],
    "autoHideMenuBar": true,
    "projectHome": "C:\\Users\\marty\\Dropbox\\Documents\\ecu"
  },
  "markdown-themeable-pdf": {}
}

Installed Packages

# User
autoclose-html, v0.18.0
language-asp, v1.0.0
language-aspx, v0.4.0
language-latex, v0.6.1
markdown-scroll-sync, v0.4.0
markdown-themeable-pdf, v0.7.2
save-session, v0.15.7
sync-settings, v0.6.0
tabs-to-spaces, v0.11.1

# Dev
No dev packages

Request: Per Project style.css/header.js/footer.js

I would like to use different styles, headers and footers for every project. My suggestion is, to look for these files in the project root, if they exist - use these - otherwise use global defaults.

Thank you by the way for this awesome project. Its easy to use and very fast.

Fontconfig error: junk after document element

When I right-click and select "Markdown to PDF" I get the following error:

Uncaught Error: Fontconfig error:
"/home/daniel/.config/fontconfig/fonts.conf", line 7: junk after document element

Stack trace:

/home/daniel/.atom/packages/markdown-themeable-pdf/lib/markdown-themeable-pdf.js:472

Error: Fontconfig error: "/home/daniel/.config/fontconfig/fonts.conf", line 7: junk after document element
    at ChildProcess.<anonymous> (/home/daniel/.atom/packages/markdown-themeable-pdf/node_modules/html-pdf/lib/pdf.js:111:17)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

Using Ubuntu 14.04 and Atom 1.7.3. I've checked for package updates and it says everything is up to date.

make header and footer functions smarter

It would be useful to generate footer and header for each page separately. Then footer and header functions could accept some parameters like actual page and so.
This will allow eg.:

  • header to be aligned left/right according to even/odd page for printed documents.
  • skip header/footer on first page, or so
  • ...

Uncaught TypeError: htmlToPdf.create(...).toStream is not a function

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.0.16
System: Microsoft Windows 10 Pro
Thrown From: markdown-themeable-pdf package, v0.9.1

Stack Trace

Uncaught TypeError: htmlToPdf.create(...).toStream is not a function

At C:\Users\Aditya\.atom\packages\markdown-themeable-pdf\lib\markdown-themeable-pdf.js:433

TypeError: htmlToPdf.create(...).toStream is not a function
  at C:\Users\Aditya\.atom\packages\markdown-themeable-pdf\lib\markdown-themeable-pdf.js:433:20
  at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)

Commands

     -0:09.4.0 command-palette:toggle (atom-text-editor.editor.is-focused)
     -0:07.1.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -0:07.1.0 markdown-themeable-pdf:export (atom-text-editor.editor)

Config

{
  "core": {}
}

Installed Packages

# User
markdown-pdf, v1.3.9
markdown-preview-plus, v2.1.1
markdown-themeable-pdf, v0.9.1

# Dev
No dev packages

Citation Support

I'm using R markdown citation notation:

This is a citation (Someone 2011)[^1]

[^1]: Someone bla bla bla information on the paper

But it is not supported by your awesome plugin. Do you have any plans on supporting anything like that?
Thanks you! :D

File links dont show well when rendered

When inserting a file link [ my file title ]( ./file-name.xls ) for example it does not show well when rendered.

For example:

Ver el archivo **[departamentos.xls](./departamentos.xls)**

is rendered as:
captura de pantalla de 2016-01-20 21 29 21

What I get is BOTH the link title AND the file url itself shown. Is there any solution to this ?

I tried other ways too:

Ver el archivo **[ departamentos ](departamentos.xls)**

Ver el archivo **[departamentos.xls](../departamentos.xls)**

but they give the same result:
captura de pantalla de 2016-01-20 21 34 35

Thanks !!!

Mario

Really good !

This is what I expected from a PDF converter ! I was really missing the page headers and footers in my pdfs. Now I could customize them for my docs.

I have one question: what other tags aside from {{page}} and {{pages}} can I use in the header and footer. I usually include the doc/file name, the doc version and the date in the footer.

I understand how to customize the date because it was in the footer.js file, but is it posible to define and/or set those variables without touching the footer.js for every file ?

Thanks again for an excellent package !!!

Mario

Text is not bolded in html tags

For certain reasons i had to manually make my list items with an ol tags and discovered that text bolding doesnt work with it. For example for the mark down :

<ol>
<li> **Hello** </li>
</ol>

results in the list item being surrounded by asteriks instead of bold. Might be the same issue with italics as well though i did not test that

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.