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

Rendered PDF is empty #39

Closed
martijnende opened this issue Dec 12, 2018 · 3 comments
Closed

Rendered PDF is empty #39

martijnende opened this issue Dec 12, 2018 · 3 comments

Comments

@martijnende
Copy link

I installed github-wikito-converter from npm, but when I try to render a PDF file, the resulting output is an empty file.

Below are the steps I took:

sudo apt install wkhtmltopdf
sudo npm install -g github-wikito-converter
git clone https://github.com/yakivmospan/github-wikito-converter.wiki.git
gwtc -v -f pdf github-wikito-converter.wiki/

Output of last step:

debug:   gwc launched with options format=pdf, output=./, filename=documentation, title=Documentation , logoImage=null, footer=null, pdfPageCount=null, tocFile=null, tocLevel=3, highlightTheme=github, userCssFile=null, verbose=true, disableInlineAssets=false
debug:   Found 1 markdown files and 1 links pointing to them in TOC
debug:   Generating pdf: 1 pages to generate

I get no errors or warnings other than quoted above. As I mentioned, the output is a plain empty file called documentation.pdf. Generating an HTML file seems to work just fine. I'm on Linux Mint 19.

@jaredbriskman
Copy link

jaredbriskman commented Dec 13, 2018

I just encountered the same issue, and resolved it. It appears the version of wkhtmltopdf in apt is not sufficient to render PDFs correctly.

(I think this has something to do with the version of QT webkit in the apt package not being patched for wkhtmltopdf, and as such failing on some of the gh-flavored markdown)

Purging my apt install of wkhtmltopdf, then Installing the latest stable static release from their site fixed the issue for me.

@martijnende
Copy link
Author

Ok, thank you for looking into it

@petrkalina
Copy link

Recent installation that seems to work at the moment:

  • from empty ubuntu image
docker run -it --rm ubuntu:bionic bash
  • wkhtmltopdf
apt-get update
apt-get install xfonts-75dpi xfonts-base gvfs colord glew-utils libvisual-0.4-plugins gstreamer1.0-tools opus-tools qt5-image-formats-plugins qtwayland5 qt5-qmltooling-plugins librsvg2-bin lm-sensors
apt-get install wget
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
...
wkhtmltopdf -V
wkhtmltopdf 0.12.5 (with patched qt)
  • github-wikito-converter
apt-get install npm
npm install -g github-wikito-converter
npm WARN deprecated datauri@1.1.0: Datauri 2.0 released. See more in https://github.com/data-uri/datauri/releases/tag/v2.0.0
npm WARN deprecated mimer@0.3.2: Mimer 1.0 released. See more in https://github.com/data-uri/mimer/releases/tag/v1.0.0
/usr/local/bin/gwtc -> /usr/local/lib/node_modules/github-wikito-converter/dist/cli/gwtc.js
/usr/local/lib
`-- github-wikito-converter@1.5.2 
  +-- bluebird@2.11.0 
  +-- bootstrap@3.4.1 
  +-- commander@2.20.3 
  +-- datauri@1.1.0 
  | +-- image-size@0.6.3 
  | +-- mimer@0.3.2 
  | `-- semver@5.7.1 
  +-- defaults@1.0.3 
  | `-- clone@1.0.4 
  +-- fs-extra@0.23.1 
  | +-- graceful-fs@4.2.3 
  | +-- jsonfile@2.4.0 
  | +-- path-is-absolute@1.0.1 
  | `-- rimraf@2.7.1 
  |   `-- glob@7.1.6 
  |     +-- fs.realpath@1.0.0 
  |     +-- inflight@1.0.6 
  |     | `-- wrappy@1.0.2 
  |     +-- inherits@2.0.4 
  |     `-- once@1.4.0 
  +-- highlight.js@9.18.1 
  +-- jquery@2.2.4 
  +-- marked@0.3.19 
  +-- node-dir@0.1.17 
  | `-- minimatch@3.0.4 
  |   `-- brace-expansion@1.1.11 
  |     +-- balanced-match@1.0.0 
  |     `-- concat-map@0.0.1 
  +-- open@0.0.5 
  +-- winston@1.1.2 
  | +-- async@1.0.0 
  | +-- colors@1.0.3 
  | +-- cycle@1.0.3 
  | +-- eyes@0.1.8 
  | +-- isstream@0.1.2 
  | +-- pkginfo@0.3.1 
  | `-- stack-trace@0.0.10 
  `-- wkhtmltopdf@0.1.6 
    `-- slang@0.3.0 

The default wiki and outcome:

apt-get install git
cd /tmp
git clone https://github.com/yakivmospan/github-wikito-converter.wiki.git

gwtc -v -f pdf github-wikito-converter.wiki/
debug:   gwc launched with options format=pdf, output=./, filename=documentation, title=Documentation , logoImage=null, footer=null, pdfPageCount=null, tocTitle=Table of contents, tocFile=null, tocLevel=3, highlightTheme=github, userCssFile=null, verbose=true, disableInlineAssets=false
debug:   Found 1 markdown files and 1 links pointing to them in TOC
debug:   Generating pdf: 1 pages to generate
info:    pdf file written: documentation.pdf
documentation.pdf

root@12164e86d115:/tmp# ls -l
-rw-r--r-- 1 root root 18864 Feb 26 19:26 documentation.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants