asciidoctor-vscode icon indicating copy to clipboard operation
asciidoctor-vscode copied to clipboard

Error converting to PDF, Error: write EPIPE

Open rmfberlin opened this issue 4 years ago • 7 comments

Description

Error while export document to PDF. Error message: Error converting to PDF, Error: write EPIPE

System Information

I'm using VS Code 1.44.2, AsciiDoc 2.7.15 and installed wkhtmltopdf v. 0.12.5 for MacOS Catalina

To Reproduce

I wrote a simple Test.adoc and tried to save to HTML: works Tried to export to PDF: Error message

Thanks Best regards Rainer

rmfberlin avatar May 01 '20 09:05 rmfberlin

+1

sesceu avatar May 06 '20 10:05 sesceu

@rmfberlin I'm sorry you've had this problem.

It's difficult for me to pinpoint the problem without knowing more about the system you are running (windows/mac/linux?) and the document you are having difficulty with.

Can you share your document -- or even better -- provide a minimal Asciidoc file which replicates the problem so we can reproduce this?

The wkhtmltopdf method used to produce pdfs is somewhat brittle and we are several versions out of date, see #239 / #252 for problems/options but upstream has not provided accessible binaries for a couple of years.

I'd suggest trying to set the data-uri attribute in your document (see the user manual) and seeing if that helps.

I'd also suggest trying installing asciidoctor-pdf and using this instead.

Finally I believe you could install and try https://github.com/Mogztter/asciidoctor-pdf.js as I've tested this and know it works a few months ago (but it's an alpha/beta project and hasn't had a stable release yet).

danyill avatar May 10 '20 03:05 danyill

In continuation with issue of @rmfberlin, my specification are as follows: OS: Windows 10 Home 64 bits. Doc: Asciidoc with images from other folder.

They are able to preview easily but when trying for 'export as PDF', error converting to PDF pop ups.

ramlaxman avatar May 10 '20 17:05 ramlaxman

@rmfberlin I'm sorry you've had this problem.

It's difficult for me to pinpoint the problem without knowing more about the system you are running (windows/mac/linux?) and the document you are having difficulty with.

MacOS Catalina 10.15.4

Can you share your document -- or even better -- provide a minimal Asciidoc file which replicates the problem so we can reproduce this?

`= testfile for pdf error :asciidoc-version: 2.0.10 [https://asciidoctor.org] :lang: de :asciidoc-file: test.adoc :data-uri: :docdate: 03.05.2020 :revnumber: 0.8 :revdate: 09.05.2020 :revnumber: 1.0 :revremark: test to convert to pdf

== Test-Doc

Some text

And more text

== new section section text`

I'd suggest trying to set the data-uri attribute in your document (see the user manual) and seeing if that helps.

I'd also suggest trying installing asciidoctor-pdf and using this instead.

Finally I believe you could install and try https://github.com/Mogztter/asciidoctor-pdf.js as I've tested this and know it works a few months ago (but it's an alpha/beta project and hasn't had a stable release yet).

With asciidoctor-pdf from command line all my files work fine.

rmfberlin avatar May 10 '20 19:05 rmfberlin

sorry, my mistake to close.

rmfberlin avatar May 10 '20 19:05 rmfberlin

Thanks @rmfberlin for providing that information. At least on my machine (Linux, Ubuntu) that test document renders correctly with wkhtmltopdf from this extension. I'm afraid I don't have Mac hardware so will struggle to test this further.

The output from wkhtmltopdf when I run the binary directly is in this gist but it produces a clean PDF file: test.pdf

You could try saving the document as HTML and then extracting and running the MacOS binary directly on the file and let us know the results of that. The binary can be found here.

@ramlaxman I can test with Windows, can you provide a minimal example document?

danyill avatar May 12 '20 05:05 danyill

My case is fixed by removing the wkhtmltopdf* files and downloading it again.

mv ~/.vscode/extensions/asciidoctor.asciidoctor-vscode-2.8.3/dist/src/commands/wkhtmltopdf* ~/tmp

Erich-Chen avatar Jul 28 '20 03:07 Erich-Chen