pdf-generation

PDF Generation out of an images list takes too long – Python

PDF Generation out of an images list takes too long – Python Question: I’m trying to generate a PDF using a list of 3 images, but it’s being a bottleneck in my program – taking up to 30 seconds per PDF. I need to process a very big amount of images, so this time just …

Total answers: 1

Using bezier curves to draw a rectangle with rounded corners in PyMuPDF

Using bezier curves to draw a rectangle with rounded corners in PyMuPDF Question: I would like to use PyMuPDF to draw a rectangle with rounded corners in a pdf. Apparently, there are no particular methods for rounded rectangles. But I was wondering if Shape.draw_bezier() or Shape.draw_curve() could be used for that purpose, making a stroke …

Total answers: 1

pyhanko cli Signing produces ConfigurationError: Error while loading key material

pyhanko cli Signing produces ConfigurationError: Error while loading key material Question: When I try to sign a PDF document from the CLI using pyhanko-cli package I get the following error: This is the command I try to run: pyhanko sign addsig –field Sig1 pemder –key example2.key –cert example2.crt source/SCRIPT_unsigned.pdf out/SCRIPT_signed_cli.pdf This is the output: Key …

Total answers: 1

VScode fails to export Jupyter notebook to HTML – 'jupyter-nbconvert` not found

VScode fails to export Jupyter notebook to HTML – 'jupyter-nbconvert` not found Question: I keep on getting error message: Available subcommands: 1.0.0 Jupyter command `jupyter-nbconvert` not found. I’ve tried to reinstall nbconvert using pip to no use. I’ve also tried the tip from this thread with installing pip install jupyter in vscode terminal but it …

Total answers: 6

How do I split a PDF in google cloud storage using Python

How do I split a PDF in google cloud storage using Python Question: I have a single PDF that I would like to create different PDFs for each of its pages. How would I be able to so without downloading anything locally? I know that Document AI has a file splitting module (which would actually …

Total answers: 3

How do I create a PDF file containing a Signature Field, using python?

How do I create a PDF file containing a Signature Field, using python? Question: In order to be able to sign a PDF document using a token based DSC, I need a so-called signature field in my PDF. This is a rectangular field you can fill with a digital signature using e.g. Adobe Reader or …

Total answers: 4

Python: Insert variable in string for LaTeX pdf generation

Python: Insert variable in string for LaTeX pdf generation Question: Hello i am fairly new to Python and i would like to automate some latex pdf report generation. So i want to make a function that takes x numbers of string variables as input and insert them into a predefined latex text, such that it …

Total answers: 2

Cannot merge pdf in python v3.6

Cannot merge pdf in python v3.6 Question: I have the following code segment which has been tested to work in python ver2.7 The code merges multiple pdfs into a single pdf. from PyPDF2 import PdfFileMerger, PdfFileReader #merge individual pdfs of each page into a single pdf merger = PdfFileMerger() for filename in pdf_list: merger.append(PdfFileReader(file(“./” + …

Total answers: 1

Create automated strictly-designed multi-page PDF report from HTML

Create automated strictly-designed multi-page PDF report from HTML Question: What are good Python-based options to create strictly designed PDF reports from HTML? I’ve attached a draft PDF to illustrate the following points: The design of the report is rather strictly designed. In other words "Looks matter". The report contains complex vector graphics (package: Matplotlib).These may …

Total answers: 2

Dynamic framesize in Python Reportlab

Dynamic framesize in Python Reportlab Question: I tried to generate a shipping list with reportlab in Python. I was trying to put all parts (like senders address, receivers address, a table) in place by using Platypus Frames. The first problem that I ran into was that I needed a lot of Frames to position everything …

Total answers: 2