question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Change output directory

See original GitHub issue

Hi all, is there any way to specify a specific directory to output the PDFs to? I supposed you could just move them afterwards but it would be nice to export them directly to another directory.

I tried pdfkit.from_string(output, “./pdfs/out.pdf”, options=options) but get this error:

File "cpa-ui.py", line 100, in generate_docs
    self.modelToPDFConverter.createInvoice(model)
  File "/Users/kevinjiang/projects/cpa-automate/ModelToPDFConverter.py", line 42, in createInvoice
    pdfkit.from_string(output, filename, options=options, css=self.css)
  File "/usr/local/lib/python3.7/site-packages/pdfkit/api.py", line 72, in from_string
    return r.to_pdf(output_path)
  File "/usr/local/lib/python3.7/site-packages/pdfkit/pdfkit.py", line 156, in to_pdf
    raise IOError('wkhtmltopdf reported an error:\n' + stderr)
OSError: wkhtmltopdf reported an error:
Loading pages (1/6)
QPainter::begin(): Returned false============================] 100%
Error: Unable to write to destination                              
Exit with code 1, due to unknown error.

Thanks in advance!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

28reactions
AcckiyGermancommented, Dec 13, 2018

pdfkit.from_string("hello world", "PATH/TO/FOLDER/WHERE/YOU/CAN/WRITE/out.pdf", options=options) Are you really studying in the University of Columbia? If so, I won’t recommend my kids to go there.

Please, close the Issue.

1reaction
citrusvanillacommented, Aug 3, 2020

@AcckiyGerman It’s “Columbia University” you dick.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change the build output directory - Visual Studio (Windows)
To change the build output directory using the current .NET Project Designer · Right-click on the project node in Solution Explorer and select ......
Read more >
visualstudio-docs/how-to-change-the-build-output-directory ...
To change the build output directory using the current .NET Project Designer · Right-click on the project node in Solution Explorer and select...
Read more >
How can I change the output directory? - MiKTeX
You can use the option --output-directory=NAME to specify an alternative location for all output files. For example, you would run
Read more >
How to change output directory for a target - xcode
1) Choose Xcode > Preferences, and click Locations. · 2) Click the Advanced button for the Derived Data setting. · 3) Select a...
Read more >
How can I change the output folder of my webUI install? - Reddit
I'm using the windows HLKY webUI which is installed on my C drive, but I want to change the output directory to a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found