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

Need help, i have this error Glyph widths in font dictionary are not consistent with embedded font program widths. #33

Closed
herizo21-dev opened this issue Apr 17, 2024 · 7 comments
Labels
invalid This doesn't seem right

Comments

@herizo21-dev
Copy link

herizo21-dev commented Apr 17, 2024

I create a facturx and I have no error, the file propriety is pdf/a-3 but when i make test i have Invalid PDF/A-3.
So the error in the title,
I get the content pdf from a html, with sannypdf
after i use $writer->generate($binaryContent, $factureXxml, null, true, [], true);

I don't know where to look and how to find the bug or my mistake

@benito103e
Copy link
Member

Firstly, hello @herizo21-dev,
We need explanation, context and example to reproduce your issue.
Without that, we won't be able to do anything.
Please do a pre-analysis before creating an issue.

@benito103e benito103e added the invalid This doesn't seem right label Apr 17, 2024
@herizo21-dev
Copy link
Author

herizo21-dev commented Apr 17, 2024

Firstly, hello @herizo21-dev, We need explanation, context and example to reproduce your issue. Without that, we won't be able to do anything. Please do a pre-analysis before creating an issue.

hello, sorry @benito103e i edited my first comment

@benito103e
Copy link
Member

Which tool do you use to check pdf/A-3 validity ?
Is your PDF generated by sannypdf (I don't know this lib) valid before adding factur-x ?
Can you share a pdf example before and after ?

@herizo21-dev
Copy link
Author

herizo21-dev commented Apr 17, 2024

Which tool do you use to check pdf/A-3 validity ? Is your PDF generated by sannypdf (I don't know this lib) valid before adding factur-x ? Can you share a pdf example before and after ?

https://services.fnfe-mpe.org/

i dont have before because I just get content from a html
but this is the result:
20240417-facture-Danny_Trejonm_&_Danny_Trejonm.pdf

1 - $binaryContent = $this->snappyPdf->getOutputFromHtml($htmls, [ 'margin-left' => '0', 'margin-right' => '0', 'margin-top' => '10', 'margin-bottom' => '12', 'footer-line' => false, 'page-size' => 'A4', 'dpi' => 150, 'footer-html' => $footer, 'footer-spacing' => '0', ]);

2 - $factureXxml = $this->generateInvoiceAdfXml($dataFacturX, $project); $writer = new Writer(); $facturxPdf = $writer->generate($binaryContent, $factureXxml, null, true, [], true); file_put_contents($filePath, $facturxPdf);

@herizo21-dev
Copy link
Author

Which tool do you use to check pdf/A-3 validity ? Is your PDF generated by sannypdf (I don't know this lib) valid before adding factur-x ? Can you share a pdf example before and after ?

Does the PDF beforehand need to already be a PDF/A-3 ?

@benito103e
Copy link
Member

benito103e commented Apr 17, 2024

Yes exactly, the initial pdf must be valid PDF/A for the Fx result to be valid.
The error "Glyph widths in font dictionary are not consistent with embedded font program widths." is already on your pdf.

@benito103e benito103e closed this as not planned Won't fix, can't repro, duplicate, stale Apr 17, 2024
@herizo21-dev
Copy link
Author

Yes exactly, the initial pdf must be valid PDF/A for the Fx result to be valid. The error "Glyph widths in font dictionary are not consistent with embedded font program widths." is already on your pdf.

Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants