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

[CHROMIUM] Route to allow source as PDF file to be converted (currently only HTML/Markdown/URL) #882

Open
michelrisucci opened this issue May 17, 2024 · 3 comments

Comments

@michelrisucci
Copy link

Currently we have Chromium routes for sources in HTML, Markdown and URLs:

image

Is there a way to have a PDF file as source?
It's useful for when you want to change it's PDF-A standard or simply by regenerating it to normalize/fix broken PDF.

Currently, PDF Engines endpoints have a route able to convert from source PDF file:

image

But it's simply not reliable as Chromium is. Tried some PDF files with EXIF pictures and it is breaking while trying to convert these attached pictures.
I would love to have the same behavior for Chromium.

@gulien
Copy link
Collaborator

gulien commented May 22, 2024

Hello @michelrisucci

Chromium only handles HTML based inputs. When you ask to convert to a specific PDF/A format, it's actually the LibreOffice PDF engine that does the job. In other words, HTML into PDF via Chromium, and then PDF/A via LibreOffice. The PDF engines endpoint just skip the HTML part and calls LibreOffice directly.

@michelrisucci
Copy link
Author

@gulien got it, but Chrome browser is able to read PDFs and regenerate them by printing to PDF.
Aren't we able to have an API to print PDF from PDF file?
I tried LibreOffice PDF engine, but, as I said, I faced some errors logging something related to "EXIF" pictures converting (PDF attachments?).

@gulien
Copy link
Collaborator

gulien commented May 23, 2024

Does Chrome really re-render a PDF? 🤔

It's useful for when you want to change it's PDF-A standard or simply by regenerating it to normalize/fix broken PDF.

So it won't work for PDF/A, but it might work to normalize a broken PDF?

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