简体   繁体   中英

PHP: Existant pdf to PDF/A

Hello Im I find pdfs hard to understand. I need to make existant pdf into pdf/a . I tried with GhostScript,

'gs -dPDFA -dBATCH -dNOPAUSE -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -sPDFACompatibilityPolicy=1 ...

But file gained alot in size. 700kb to 14Mb. Such size is not acceptable. I need alternative. anyone has any idea?

You should not expect a command line tool to be able to convert PDF to PDF/A. You should also not be surprised that a file grows in file size when you want to create a PDF/A document from a PDF.

To create a PDF/A from a PDF, you need to:

  1. add XMP metadata,
  2. embed all fonts that were previously not embedded (usually you can't do this from the command line because you'll need to provide a path to a font file in case a font program isn't found),
  3. add a color profile,
  4. remove all encryption,
  5. remove JavaScript.

Unless the requirement is to create PDF/A-3, you may also have to convert all attachments to PDF/A.

Your question should be closed as off-topic as it does not contain a specific programming problem (eg some source code that we can fix). It is a very broad question and your expectation that you can do this without understanding PDF is too optimistic.

Your question also contains a contraction. In the subject line you mention PHP and in the tags you mention iText. iText is not a PHP library and you don't mention iText in your question anywhere.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM