manuelbl / SwissQRBill.NET

.NET library for Swiss QR bill payment slips (aka QR-Rechnung)
MIT License
86 stars 32 forks source link

PDF Issue with Acrobat Reader #18

Closed stefanDge closed 4 years ago

stefanDge commented 4 years ago

Hi, I use this great Library to create PDF-Files. It works fine with different PDF-Viewers, but Acrobat Reader reports error 14 „dict object expected“. Acrobat Reader opens and displays your reference files from the test-project without erros. When I run the tests, CreateA4PdfBill1() fails when files are compared. Analyzing the corrupted file the page-dimensions are shown as 595 x 0.

This is my testcode

   bill.Format.GraphicsFormat = GraphicsFormat.PDF;
   bill.Format.SeparatorType = SeparatorType.DottedLineWithScissors;
   bill.Format.Language = Language.DE;
   byte[] pdf = QRBill.Generate(bill);
   File.WriteAllBytes(path, pdf);

when I use PDFCanvas canvas = new PDFCanvas(QRBill.A4PortraitWidth, QRBill.A4PortraitHeight); QRBill.Draw(bill, canvas); canvas.SaveAs(path);

the same error comes up. Is there any solution for this problem?

Thank you very mutch in advance

Stefan

manuelbl commented 4 years ago

At first sight, it looks as if the bug was somehow dependent on the environment as even the unit tests fail. Can yo.u provide more information about your environment (operation system, .NET version, development tools used to run unit tests etc.)?

Can you also add the PDF file of the unit test that fails? If the file comparison fails, the generated file is not deleted. It should be named actual_a4bill_ex1.pdf and be located in the working directory where the unit tests were run.

stefanDge commented 4 years ago

actual_a4bill_ex1.pdf

Thank you very much for your reply. I compiled the sources on Win 10 (1909) with VS 2019 and and on an other machine with VS 2017 on Win 10 (1909). I tryed different .Net Versions with the same result. The software I wrote is a .Net Core 2.1 Application (VS2017) and integrates your lib with NuGet. Version is 2.3.4 (2.3.1 produces the same result). The file can be read from Sumatra, Firefox or Edge (Chromium) and fails with Edge (older version) and Acrobat Reader DC (current version). Stefan

manuelbl commented 4 years ago

See continuation in issue #19