pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Overlaying PDFs > 1.4 fails & Hyperlinks are not clickable in overlays
Date Thu, 10 Mar 2016 20:09:59 GMT
Am 10.03.2016 um 19:39 schrieb Anna Taracha:
> Hello!
>
> You can find the original PDF file and the overlay PDF file here:
>
> http://www.elisanet.fi/jakorasia/ANNA/doc.pdf (original PDF)
> http://www.elisanet.fi/jakorasia/ANNA/wm.pdf (overlay file)

None of them is a PDFA file. They have many other errors beside the XRef 
streams, although these can be fixed.

Apparently there is another problem with overlays, Andreas just reopened 
a closed issue because of that.

>
> They both have XRef streams and do not have parameter errors 
> (according to 3-Heights™ PDF Validator Online Tool). They are based on 
> version 1.5. The result file has parameter error so something strange 
> happens during overlaying. As all the files are based on version 1.5, 
> they should be allowed to have XRef streams which was introduced in 
> version 1.5. Preflight can validate only PDF/A-1b which is based on 
> version 1.4 so I can't use it to validate PDFs 1.5 fully.
>
> However, your suggested code did the trick and now my PDF files are 
> valid. I guess there is something wrong with XRef stream after 
> overlaying. I will use your code as a workaround for now, so thank you 
> for it :)
>
> Yes, I was asking, if clickable hyperlinks in overlays will be 
> possible in a future release (you would create a similar feature that 
> I did)? I am just curious, if it is something that will/could be 
> considered.

I can't answer that because I have no opinion, I've never used that 
overlay feature. I assume you mean transferring annotations that are in 
the overlay file. Isn't this something that can also be done by just 
adding the annotation to the page annotation list? What would happen if 
both pages have different sizes?

But feel free to share any code you have. We have committed many user 
suggestions, but not every suggestion gets committed. If it is refused 
or ignored, just keep trying and come back with more new ideas :-)


Tilman

>
> -anna-
>
> On 09.03.2016 22:22, Tilman Hausherr wrote:
>> Am 09.03.2016 um 16:47 schrieb Anna Taracha:
>>> Result of PDFBox 2.0.0-RC3:
>>>
>>> http://www.elisanet.fi/jakorasia/ANNA/result-PDFBox2.pdf
>>>
>>> Result of PDFBox 1.8.11:
>>>
>>> http://www.elisanet.fi/jakorasia/ANNA/result-PDFBox18.pdf
>>
>> Here's what I get with PDF-Tools:
>>
>> 1.8:
>> Validating file "result-PDFBox18.pdf" for conformance level pdfa-1b
>> dc:language :: Wrong value type. Expected type 'bag'.
>> dc:date :: Wrong value type. Expected type 'seq'.
>> The required XMP property 'pdfaid:part' is missing.
>> The required XMP property 'pdfaid:conformance' is missing.
>> A device-specific color space (DeviceGray) without an appropriate 
>> output intent is used.
>> The document does not conform to the requested standard.
>> The document contains device-specific color spaces.
>> The document's meta data is either missing or inconsistent or corrupt.
>> Done.
>>
>> 2:
>> Validating file "result-PDFBox2.pdf" for conformance level pdfa-1b
>> The file contains cross reference streams. <=====================
>> The file trailer dictionary is missing or invalid. <=================
>> dc:language :: Wrong value type. Expected type 'bag'.
>> dc:date :: Wrong value type. Expected type 'seq'.
>> The required XMP property 'pdfaid:part' is missing.
>> The required XMP property 'pdfaid:conformance' is missing.
>> A device-specific color space (DeviceGray) without an appropriate 
>> output intent is used.
>> The document does not conform to the requested standard.
>> The file format (header, trailer, objects, xref, streams) is corrupted.
>> The document contains device-specific color spaces.
>> The document's meta data is either missing or inconsistent or corrupt.
>> Done.
>>
>>
>>
>> preflight has a similar error for 2.0 only:
>> 1.4 : Trailer Syntax error, /XRef cross reference streams are not 
>> allowed
>>
>>
>> Please try this before saving:
>>
>>         doc.getDocument().setIsXRefStream(false);
>>         COSDictionary trailer = doc.getDocument().getTrailer();
>>         trailer.removeItem(COSName.W);
>>         trailer.removeItem(COSName.DECODE_PARMS);
>>         trailer.removeItem(COSName.FILTER);
>>         trailer.removeItem(COSName.TYPE);
>>         trailer.removeItem(COSName.INDEX);
>>         trailer.removeItem(COSName.LENGTH);
>>
>>
>> About your other question - it is unclear. Are you asking whether 
>> Overlay will be available in the future? Or do you want us to create 
>> a feature like the one you did on your own?
>>
>> Tilman
>>>
>>> -anna-
>>>
>>> On 07.03.2016 19:19, Tilman Hausherr wrote:
>>>> Could you upload two documents, one good and one bad? I'll have a 
>>>> look with PDFDebugger to find out what's wrong.
>>>>
>>>> Tilman
>>>>
>>>> Am 07.03.2016 um 16:30 schrieb Anna Taracha:
>>>>> Hi,
>>>>>
>>>>> I am having trouble overlaying PDFs of version 1.5 (or higher) 
>>>>> when using PDFBox 2.0.0-RC3. The result PDF has parameter error in 
>>>>> it according to 3-Heights™ PDF Validator Online Tool. Overlaying 
>>>>> PDFs of version 1.4 (PDF 1.4, PDF/A-1a and PDF/A-1b) works fine.
>>>>>
>>>>> To reproduce:
>>>>> 1. Download pdfbox-app-2.0.0-RC3.jar
>>>>> 2. Overlay two PDF(/A) documents of version 1.5 (or higher)
>>>>> /- java -jar pdfbox-app-2.0.0-RC3.jar OverlayPDF doc.pdf wm.pdf 
>>>>> -position foreground result.pdf/
>>>>> 3. Validate result.pdf with a PDF validator (I used 3-Heights™ PDF

>>>>> Validator Online Tool)
>>>>>
>>>>> The result of the validation is 'parameter error'. However, 
>>>>> overlaying the exact same PDFs using pdfbox-app-1.8.11.jar works 
>>>>> fine. Is there some regression in PDFBox 2.0.0-RC3 regarding 
>>>>> overlaying PDFs of version > 1.4? I tested OverlayPDF//with many 
>>>>> simple PDFs (version > 1.4) and all of them resulted in parameter

>>>>> error when using PDFBox 2.0.0-RC3.
>>>>>
>>>>> I have also a question about making hyperlinks clickable in 
>>>>> overlays. I am able to do it by modifying Overlay.java but I was 
>>>>> wondering, if this feature will be available in some later release?
>>>>>
>>>>> Best regards,
>>>>> Anna
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message