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

fpdf.output() Linux vs Mac #196

Open
master0v opened this issue Feb 1, 2022 · 2 comments
Open

fpdf.output() Linux vs Mac #196

master0v opened this issue Feb 1, 2022 · 2 comments

Comments

@master0v
Copy link

master0v commented Feb 1, 2022

On a mac machine fpdf.output() returns this:

bytearray(b'%PDF-1.3\n3 0 obj\n<</Type /Page\n/Parent 1 0 R\n/Resources 2 0 R\n/Contents 4 0 R>>\nendobj\n4 0 obj\n<</Filter /FlateDecode /Length 156>>\nstream\nx\x9c\x8d\x8f\xb9\nBA\x0cE\xe3\xae\xe3O\xdcR\x9b\x98\xc9L\xe6\xf1ZA\x0b;a>A\x14\xec\xb4\xf1\xf7\x8d\x8a\xb84\xda\x9c\x90\x85{\x88b\x13\x84\xad\xc1%,+\x16kE\x14\x96\x84\xba\xc7\xaa\x86\x13|W\xda\x0f\x9e\x0f\xf0\xcb\x9c\x12\x97\x8c\xc6\x94\xb3\xa2\xee0\xa3\x0eu\xa9G}\x1a8\x87\x04\x1a\xd1\xd8\'\x13\xef\x02a\x8ez\xf4Dl\x1f\x9a\xf8\xa7\xc6\x92qc\x1f\x1a\x90Pt\x99\x90:\xf5^\xf5+>#E...

while on a linux the same function returns this:

%PDF-1.3 3 0 obj <</Type /Page /Parent 1 0 R /Resources 2 0 R /Contents 4 0 R>> endobj 4 0 obj <</Filter /FlateDecode /Length 211>> stream x���½K�A�Ä·�êªÃ��D�¬"�½·o÷Ý%�"�-$��--EÁN�ÿ}_.¢I*�ÙeÞ0?FùØH´�_Í¢²{P&��Y_y_��ú­�ïèç�=�-ÅYæ��²¾p�ç Z�¢Ã!Np�6�Gî�Stþo×�.pî�)�q°É\²¾;�O�~ú'ß²ÅÁ¶ù�AB
ÑU]u|u¯¾0§¨²U_,¹Ê¼¬ë�üÔ��¦ì��{û]'¸Æ
�3Ü@Æu�;,±�×¹��n=³�AÇÌÕ�þ�xâ<�...`

the outputs are of course incomplete, but you get the difference. This causes incompatibilities in the code down the line.

@master0v
Copy link
Author

master0v commented Feb 1, 2022

looks like the mac version was/wasn't updated according to this https://pyfpdf.readthedocs.io/en/latest/reference/output/index.html

@Lucas-C
Copy link

Lucas-C commented Mar 1, 2022

pyfpdf is not maintained anymore, have you tried using fpdf2?
https://pyfpdf.github.io/fpdf2/

Note that both pyfpdf & fpdf2 use Pillow, that itself uses libjpeg-turbo on Windows and libjpeg elsewhere, leading to a slightly different image being parsed and included in the PDFs.

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

2 participants