0

As the title states does iOS support PDF/A?

I tried to open it, but mostly I get a white page with errors like

illegal character `/' encountered in hex string.
illegal character `/' encountered in hex string.
invalid stream length 557; should be 563.
FlateDecode: decoding error: invalid distance too far back.
FlateDecode: decoding error: invalid distance too far back.
invalid stream length 51645; should be 52016.
FlateDecode: decoding error: invalid bit length repeat.
FlateDecode: decoding error: invalid distance too far back.
FlateDecode: decoding error: invalid distance too far back.

Perhaps I'm doing something wrong, but I didn't found any information which types of PDF the UIWebView or QLPreviewController support.

Edit:

Now I created a Word 2007 document with a single text line and saved it as normal PDF (with Adobe Plugin). Then I openend the PDF and converted it to the different available standards with the Preflight tool:

  • PDF/A-1a
  • PDF/A-1b
  • PDF/A-2a
  • PDF/A-2b
  • PDF/A-2u

I also checked if it is really supporting this standard with the Preflight tool. Then I displayed the PDF/A on my UIWebView and the text got displayed and I didn't get an error in the console.

Then I got it managed to get access to the problematic PDF and I also checked it with the Preflight tool. The summary for PDF/A-1a and PDF/A-1b was:

  • File header is not compatible with PDF/A
  • Syntax problem: PDF file contains data after end of file

It doesn't meet any of the standards available in the Preflight tool. So yes iOS does support PDF/A, but you have to check if your PDF is valid.

testing
  • 19,681
  • 50
  • 236
  • 417
  • Those error messages sound like the file is not even valid PDF... – mkl Apr 28 '15 at 07:49
  • As I said it could be that I've done something wrong. But the file can be opened in another application so it should be valid PDF. I'm afraid that `PDF/A` isn't supported, because other PDFs does work fine with my code. – testing Apr 28 '15 at 07:51
  • 2
    *But the file can be opened in another application so it should be valid PDF.* - That assumption usually is wrong. PDF (Pre)viewers tend to ignore many errors in PDFs. E.g. in case of your error messages, viewers may simply read a stream to its end, ignoring its length entry, or they may read `length` many bytes ignoring whether that reads exactly to the stream end. – mkl Apr 28 '15 at 07:57
  • So how can I check if a PDF has errors or not? – testing Apr 28 '15 at 08:00
  • 2
    Some software packages contain Preflight tools allowing to check for PDF syntax errors, e.g. Adobe Acrobat (nor Reader!) does. You may also share your PDF here, probably some reader has such a tool at hands. – mkl Apr 28 '15 at 08:09
  • If I understand you correctly Adobe Acrobat can do this, but not the Reader. So the key word for searching is *Preflight*. Is this a term by Adobe or is this the correct key word for searching after such tools? I'm afraid that I'm not allowed to share the PDF. – testing Apr 28 '15 at 08:17
  • 1
    Then create a test PDF -- make sure it has these exact same issues. – Jongware Apr 28 '15 at 08:37
  • *Is this a term by Adobe or is this the correct key word for searching after such tools* - It is used by Adobe and others, but such tools may also be called "PDF syntax validator" or anything like that. Alternatively, as @Jongware says, provide a test PDF, e.g. using dummy inputs with your PDF generating software. – mkl Apr 28 '15 at 08:43
  • The PDF was imported by an external interface into the system. Now I got access to this file directly and checked it for errors. As you assumed the file is corrupt. Thanks all for your help. – testing Apr 30 '15 at 06:20

1 Answers1

2

The short answer to your question is: yes.

The longer one is, well... a bit longer :)

PDF/A, or PDF for Archival is an ISO standard that is based on the ISO standard for PDF itself (ISO 32.000). As a consequence, any software that supports "PDF" must also necessarily support PDF/A. Or otherwise stated, all PDF/A files are PDF files, but not all PDF files are PDF/A files.

To complicate matters though... there are many different versions of PDF out there, and there are at least 8 different forms (parts and flavours together) of PDF/A. Not all software supports all versions of PDF, more advanced features (such as JPEG-2000 compression to name but one example) might not be supported by your particular platform or software of choice.

So you have two steps to go through:

1) Make sure your PDF/A is valid - there is commercial software to do this such as Adobe Acrobat or callas pdfToolbox or pdfaPilot (caution: I'm affiliated with these applications) and there is free software to do this (have a look here: http://www.pdf-tools.com/pdf/validate-pdfa-online.aspx for example).

2) If your PDF/A is valid, make sure that your software / platform supports the features in that particular PDF/A file you are looking at. PDF/A-1 for example is an older standard than PDF/A-3 and supports less features. Hence you'll have a greater chance that a PDF/A-1 file is supported than a PDF/A-3 file.

David van Driessche
  • 6,602
  • 2
  • 28
  • 41