pyfpdf
pyfpdf copied to clipboard
fpdf output string encoding
I have created a pdf object using FPDF, and am trying to save to Microsoft Azure Blob storage.
I can save the FPDF-object fine locally using pdf.output('savename.pdf', 'F')
To store in Blob, it seems I need to convert the object to data. I have tried data_str = pdf.output('savename.pdf', 'S'), then upload data_str to Blob. This saves the PDF file, but it is blank (although the file size is the same as the full popularly pdf).
I am guessing this is an encoding issue, with which I have limited familiarity. What is the encoding of the string coming out of pdf.output('savename.pdf', 'S')? I can't find anywhere in the documentation.
Any guidance with this issue would be extremely helpful.
I can answer for https://pypi.org/project/fpdf2/ : the encoding is latin-1