Re: RE%3A Re%3A [External Sender] Re%3A PDFBox 3.0.1 compile dependency on junit-jupiter&In-Reply-To=<9f543108-ef5c-4c7a-bac8-d7c6009d9d5f%40gmail.com>

2024-01-10 Thread Andreas Lehmkühler

Hi,

the additional compile dependency shouldn't have any influence on your 
test cases as long as you don't change change something.


I'm wondering if you are following the advice and excluded the junit 
dependency?


Andreas

Am 05.01.24 um 12:16 schrieb Christian Wiech via users:

I just discovered that after a renovate bot update three weeks ago from 
pdfbox-3.0.0 to pdfbox-3.0.1 our builds are still green but no tests are 
executed at all. This means we were blind for about 3 weeks because of an 
automerged bugfix release.

We are not using TestNG but Junit provided by Spring Boot version 3.X. The 
tests are not failing but simply skipped and reported as passed. This leaves us 
in a false assumption of safety.
Gilis workaround for TestNG works for in our case too. But in my mind this is a 
major incident and should be fixed asap.
Cheers, Christian
On 2023/12/04 17:55:58 Gili Tzabari wrote:

For anyone else using TestNG for unit tests, you'll need to explicitly
exclude JUnit until this is fixed; otherwise, Surefire will refuse to
use TestNG.

org.apache.pdfbox pdfbox 3.0.1 org.junit.jupiter junit-jupiter

Gili

On 2023-12-03 20:47, Dan Rabe wrote:

Great, thank you! We’ll look forward to seeing this in the next release!

--Dan

From: Andreas Lehmkühler
Date: Sunday, December 3, 2023 at 1:58 PM
To:users@pdfbox.apache.org
Subject: [External Sender] Re: PDFBox 3.0.1 compile dependency on junit-jupiter
solved, see [1] for further details.

Andreas

[1]https://urldefense.com/v3/__https://issues.apache.org/jira/browse/PDFBOX-5722__;!!Iz9xO38YGHZK!86ddyxmB45umUPT5RruBNFFOHrj4DuhHNvfFoJ0V1eQuJhQo9dtUS41wP9sKfM2mKCyhfjyTwkVcb52L0AYxMorg$

Am 02.12.23 um 09:05 schrieb Andreas Lehmkühler:

Hi,

Am 01.12.23 um 17:14 schrieb Dan Rabe:

It looks like a compile dependency on junit-jupiter snuck into the
3.0.1 release.

If I look at the maven page for 3.0.0 at
https://urldefense.com/v3/__https://mvnrepository.com/artifact/org.apache.pdfbox/pdfbox/3.0.0__;!!Iz9xO38YGHZK!86ddyxmB45umUPT5RruBNFFOHrj4DuhHNvfFoJ0V1eQuJhQo9dtUS41wP9sKfM2mKCyhfjyTwkVcb52L0IYlyu3Q$
 ,
junit-jupiter is listed as a test dependency.
If I look at the maven page for 3.0.1 at
https://urldefense.com/v3/__https://mvnrepository.com/artifact/org.apache.pdfbox/pdfbox/3.0.1__;!!Iz9xO38YGHZK!86ddyxmB45umUPT5RruBNFFOHrj4DuhHNvfFoJ0V1eQuJhQo9dtUS41wP9sKfM2mKCyhfjyTwkVcb52L0Bp0SxKX$
 ,
junit-jupiter is listed as a compile dependency.

As a result, the war file that I build would contain the junit
libraries. I’m assuming it’s a mistake of some sort that it got
reclassified as “compile” rather than “test”?

Your assumption is correct, it's a mistake. It was introduce with
PDFBOX-5699 which rearranged some parts of the maven build. My bad :-(

I'm going to fix that and doublecheck all the other components.

Thanks for the report

Andreas

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


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



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



Re: merging a pre-existing file with a new page

2024-01-10 Thread Tilman Hausherr

Hi,

Please retry with 2.0.* (there use PDDocument.load()) and with a 
snapshot version of 3.0.2 because we fixed bugs related to what you mention:

https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.2-SNAPSHOT/

If it doesn't work, please try with the command line merge application, 
and please upload the PDFs to a sharehoster, and post the smallest 
possible code that reproduces the problem.


Tilman

On 11.01.2024 03:46, Vaishant Bafna wrote:

Hey!

I am using pdfbox-app-3.0.1 API for a PDF merging facility on my
application made on Java NetBeans IDE 18. However, when I am compiling and
using the 'Loader' to load my PDF files from the desktop and merge a
pre-existing batch file with a new page I would like to add, it adds the
page as a blank one! I am unable to solve this problem! Can someone please
help me with this?



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



Question

2024-01-10 Thread Vaishant Bafna
Hey!

I am using pdfbox-app-3.0.1 API for a PDF merging facility on my
application made on Java NetBeans IDE 18. However, when I am compiling and
using the 'Loader' to load my PDF files from the desktop and merge a
pre-existing batch file with a new page I would like to add, it adds the
page as a blank one! I am unable to solve this problem! Can someone please
help me with this?

REGARDS,
Vaishant Bafna
[image: phone-icon]  bafnavaish...@gmail.com
*__*

The content of this email is confidential and intended for the recipient
specified in message only. It is strictly forbidden to share any part of
this message with any third party, without a written consent of the sender.
If you received this message by mistake, please reply to this message and
follow with its deletion, so that I can ensure such a mistake does not
occur in the future.


Re: FW: PDFBox 3.0.1 Font changes when rendering PDF to Image

2024-01-10 Thread Tilman Hausherr

Hi,

That's why I mentioned to look at the log messages, there would be one 
mentioning that a fallback font is used.


The alternative would be to implement your own FontMapper. Call 
FontMappers.set() with your own FontMapper. To see how to implement your 
own, look at the source code of FontMapperImpl class.


All this is not trivial, probably a several days of work. The best would 
be to expand the "lastResortFont" part to support all standard 14 fonts 
instead of just having LiberationSans.


Tilman



On 10.01.2024 16:37, Lisa Moore wrote:


I think the issue is that the required font it not on the Azure 
Kubernetes image that we are now running on.   We are not allowed to 
load any fonts on this image.   Is there a way to embed the required 
font into the java code that is creating the image from the PDF file?  
The java code is included below:


*public**class*PDFToImage  {

*public**static*Object transformMessage(String baos) *throws*Exception

{

 ByteArrayOutputStream[] _imageBaos_;

*byte*[] decodedString= 
Base64./getDecoder/().decode(baos.getBytes("UTF-8"));


// Get the input stream

*try*(PDDocument pddDoc=  Loader./loadPDF/(decodedString) ){

PDFRenderer pr= *new*PDFRenderer (pddDoc);

*int*pageCount= pddDoc.getNumberOfPages();

BufferedImage bim= *new*BufferedImage(25,25, 
BufferedImage.*/TYPE_INT_ARGB/*);


ByteArrayOutputStream stream= *new*ByteArrayOutputStream();

imageBaos= *new*ByteArrayOutputStream[pageCount];

*for*(*int*page= 0; page*private**static*BufferedImage joinBufferedImage(BufferedImage img1, 
BufferedImage img2) {


// *TODO*Auto-generated method stub

*int*offset= 5;

*int*wid= Math./max/(img1.getWidth(),img2.getWidth() + offset);

*int*height= img1.getHeight() + img2.getHeight() + offset;

BufferedImage newImage= 
*new*BufferedImage(wid,height,BufferedImage.*/TYPE_INT_RGB/*);


Graphics2D g2= newImage.createGraphics();

Color oldColor= g2.getColor();

g2.setPaint(Color.*/WHITE/*);

g2.fillRect(0, 0, wid, height);

g2.setColor(oldColor);

g2.drawImage(img1, *null*, 0, 0);

g2.drawImage(img2, *null*, 0, img1.getHeight() + offset);

g2.dispose();

*return*newImage;

}

}

*From:* Tilman Hausherr 
*Sent:* Wednesday, January 10, 2024 10:17 AM
*To:* users@pdfbox.apache.org
*Subject:* Re: FW: PDFBox 3.0.1 Font changes when rendering PDF to Image

*
**  External Email - Use Caution *

Hi,

I tested with 3.0.1 and got one log message:

Unexpected XRefTable Entry: 0    24

that's because that line is " 0 24" instead of "0 24". However 
that doesn't seem to have a negative effect. Here's how the image looks:


Tilman

On 10.01.2024 15:52, Lisa Moore wrote:

A sample PDF file can be seen here:


https://www.dropbox.com/scl/fi/w5zgfrqbulungxd4dpq37/MuseTest.pdf?rlkey=jskisldanhoxf3pvcqqy6nk7b&dl=0
  


-Original Message-

From: Tilman Hausherr  

Sent: Wednesday, January 10, 2024 8:09 AM

To:users@pdfbox.apache.org

Subject: Re: FW: PDFBox 3.0.1 Font changes when rendering PDF to Image

   External Email - Use Caution

Hi,

We'd need the PDF file, please upload to a sharehoster. Your attachments 
(all of them) didn't get through.

Also try to use the latest snapshot


https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.2-SNAPSHOT/

and look at the log messages.

Tilman

On 10.01.2024 13:39, Lisa Moore wrote:

*From:* Lisa Moore

*Sent:* Tuesday, January 9, 2024 10:54 AM

*To:*users-h...@pdfbox.apache.org

*Subject:* PDFBox 3.0.1 Font changes when rendering PDF to Image

Hi,

I am using PDFBox to render a PDF to a .png image.  In the past,  I

used version 2.0.23 which worked without issue.  When the image is

rendered in verion 3.0.1, the text part of the PDF document does not

properly convert the Font (Times Roman).   How can I fix this issue?

I have attached the images to show the comparison of what is being

rendered in version 3.0.1 versus 2.0.23.

Thanks for any help you can provide.

Lisa Moore

-

To unsubscribe,e-mail:users-unsubscr...@pdfbox.apache.org

For additional commands,e-mail:users-h...@pdfbox.apache.org

-

To unsubscribe, e-mail:users-unsubscr...@pdfbox.apache.org

For additional commands, e-mail:users-h...@pdfbox.apache.org



RE: FW: PDFBox 3.0.1 Font changes when rendering PDF to Image

2024-01-10 Thread Lisa Moore
I think the issue is that the required font it not on the Azure Kubernetes 
image that we are now running on.   We are not allowed to load any fonts on 
this image.   Is there a way to embed the required font into the java code that 
is creating the image from the PDF file?  The java code is included below:

public class PDFToImage  {


   public static Object transformMessage(String baos) throws Exception
   {
 ByteArrayOutputStream[] imageBaos;
 byte[] decodedString = 
Base64.getDecoder().decode(baos.getBytes("UTF-8"));
 // Get the input stream
 try(PDDocument pddDoc =  Loader.loadPDF(decodedString) ){
PDFRenderer pr = new PDFRenderer (pddDoc);
int pageCount = pddDoc.getNumberOfPages();
BufferedImage bim = new BufferedImage(25,25, 
BufferedImage.TYPE_INT_ARGB);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
imageBaos = new ByteArrayOutputStream[pageCount];
for (int page = 0; page
Sent: Wednesday, January 10, 2024 10:17 AM
To: users@pdfbox.apache.org
Subject: Re: FW: PDFBox 3.0.1 Font changes when rendering PDF to Image


  External Email - Use Caution




Hi,

I tested with 3.0.1 and got one log message:

Unexpected XRefTable Entry: 024

that's because that line is " 024" instead of "0 24". However that 
doesn't seem to have a negative effect. Here's how the image looks:

[cid:image001.png@01DA43B0.E1C6D3E0]

Tilman

On 10.01.2024 15:52, Lisa Moore wrote:

A sample PDF file can be seen here:

https://www.dropbox.com/scl/fi/w5zgfrqbulungxd4dpq37/MuseTest.pdf?rlkey=jskisldanhoxf3pvcqqy6nk7b&dl=0



-Original Message-

From: Tilman Hausherr 

Sent: Wednesday, January 10, 2024 8:09 AM

To: users@pdfbox.apache.org

Subject: Re: FW: PDFBox 3.0.1 Font changes when rendering PDF to Image





  External Email - Use Caution







Hi,



We'd need the PDF file, please upload to a sharehoster. Your attachments (all 
of them) didn't get through.

Also try to use the latest snapshot

https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.2-SNAPSHOT/

and look at the log messages.

Tilman



On 10.01.2024 13:39, Lisa Moore wrote:



*From:* Lisa Moore

*Sent:* Tuesday, January 9, 2024 10:54 AM

*To:* users-h...@pdfbox.apache.org

*Subject:* PDFBox 3.0.1 Font changes when rendering PDF to Image



Hi,



I am using PDFBox to render a PDF to a .png image.  In the past,  I

used version 2.0.23 which worked without issue.  When the image is

rendered in verion 3.0.1, the text part of the PDF document does not

properly convert the Font (Times Roman).   How can I fix this issue?

I have attached the images to show the comparison of what is being

rendered in version 3.0.1 versus 2.0.23.



Thanks for any help you can provide.



Lisa Moore





-

To unsubscribe, 
e-mail:users-unsubscr...@pdfbox.apache.org

For additional commands, 
e-mail:users-h...@pdfbox.apache.org





-

To unsubscribe, e-mail: 
users-unsubscr...@pdfbox.apache.org

For additional commands, e-mail: 
users-h...@pdfbox.apache.org






Re: FW: PDFBox 3.0.1 Font changes when rendering PDF to Image

2024-01-10 Thread Tilman Hausherr

Hi,

I tested with 3.0.1 and got one log message:

Unexpected XRefTable Entry: 0    24

that's because that line is " 0 24" instead of "0 24". However that 
doesn't seem to have a negative effect. Here's how the image looks:



Tilman

On 10.01.2024 15:52, Lisa Moore wrote:

A sample PDF file can be seen here:
https://www.dropbox.com/scl/fi/w5zgfrqbulungxd4dpq37/MuseTest.pdf?rlkey=jskisldanhoxf3pvcqqy6nk7b&dl=0

-Original Message-
From: Tilman Hausherr
Sent: Wednesday, January 10, 2024 8:09 AM
To:users@pdfbox.apache.org
Subject: Re: FW: PDFBox 3.0.1 Font changes when rendering PDF to Image


   External Email - Use Caution



Hi,

We'd need the PDF file, please upload to a sharehoster. Your attachments (all 
of them) didn't get through.
Also try to use the latest snapshot
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.2-SNAPSHOT/
and look at the log messages.
Tilman

On 10.01.2024 13:39, Lisa Moore wrote:

*From:* Lisa Moore
*Sent:* Tuesday, January 9, 2024 10:54 AM
*To:*users-h...@pdfbox.apache.org
*Subject:* PDFBox 3.0.1 Font changes when rendering PDF to Image

Hi,

I am using PDFBox to render a PDF to a .png image.  In the past,  I
used version 2.0.23 which worked without issue.  When the image is
rendered in verion 3.0.1, the text part of the PDF document does not
properly convert the Font (Times Roman).   How can I fix this issue?
I have attached the images to show the comparison of what is being
rendered in version 3.0.1 versus 2.0.23.

Thanks for any help you can provide.

Lisa Moore


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


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



RE: FW: PDFBox 3.0.1 Font changes when rendering PDF to Image

2024-01-10 Thread Lisa Moore
A sample PDF file can be seen here:
https://www.dropbox.com/scl/fi/w5zgfrqbulungxd4dpq37/MuseTest.pdf?rlkey=jskisldanhoxf3pvcqqy6nk7b&dl=0

-Original Message-
From: Tilman Hausherr 
Sent: Wednesday, January 10, 2024 8:09 AM
To: users@pdfbox.apache.org
Subject: Re: FW: PDFBox 3.0.1 Font changes when rendering PDF to Image


  External Email - Use Caution



Hi,

We'd need the PDF file, please upload to a sharehoster. Your attachments (all 
of them) didn't get through.
Also try to use the latest snapshot
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.2-SNAPSHOT/
and look at the log messages.
Tilman

On 10.01.2024 13:39, Lisa Moore wrote:
>
> *From:* Lisa Moore
> *Sent:* Tuesday, January 9, 2024 10:54 AM
> *To:* users-h...@pdfbox.apache.org
> *Subject:* PDFBox 3.0.1 Font changes when rendering PDF to Image
>
> Hi,
>
> I am using PDFBox to render a PDF to a .png image.  In the past,  I
> used version 2.0.23 which worked without issue.  When the image is
> rendered in verion 3.0.1, the text part of the PDF document does not
> properly convert the Font (Times Roman).   How can I fix this issue?
> I have attached the images to show the comparison of what is being
> rendered in version 3.0.1 versus 2.0.23.
>
> Thanks for any help you can provide.
>
> Lisa Moore
>
>
> -
> To unsubscribe, e-mail:users-unsubscr...@pdfbox.apache.org
> For additional commands, e-mail:users-h...@pdfbox.apache.org


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



Re: java.io.IOException: Unknown dir object c='>' cInt=62 peek='>' peekInt=62

2024-01-10 Thread Tilman Hausherr

Hi,

This is a syntax error in the PDF. There should be another token after "/N".

Tilman

On 10.01.2024 13:19, John, Ines wrote:


Hello PdfBox-Team,

we have the following problem in our project:

When merging documents we get an exception for a certain document. 
That’s why we updated the version of pdfBox to 3.0.1. Now we can merge 
the documents but we still get the error in the logfile.


We merge documents by using *pdfMergerUtility.mergeDocuments();*

Extract from the logfile:

2024-01-10 09:36:34.396 ERROR 11764 --- [pool-1-thread-1] 
org.apache.pdfbox.cos.COSObject  : Can't dereference 
COSObject{14, 0}


java.io.IOException: Unknown dir object c='>' cInt=62 peek='>' 
peekInt=62 at offset 179966 (start offset: 179966)


   at 
org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:921) 
~[pdfbox-3.0.1.jar:3.0.1]


   at 
org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionaryValue(BaseParser.java:187) 
~[pdfbox-3.0.1.jar:3.0.1]


   at 
org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionaryNameValuePair(BaseParser.java:347) 
~[pdfbox-3.0.1.jar:3.0.1]


   at 
org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionary(BaseParser.java:263) 
~[pdfbox-3.0.1.jar:3.0.1]


   at 
org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:882) 
~[pdfbox-3.0.1.jar:3.0.1]


   at 
org.apache.pdfbox.pdfparser.COSParser.parseFileObject(COSParser.java:734) 
~[pdfbox-3.0.1.jar:3.0.1]


   at 
org.apache.pdfbox.pdfparser.COSParser.parseObjectDynamically(COSParser.java:668) 
~[pdfbox-3.0.1.jar:3.0.1]


   at 
org.apache.pdfbox.pdfparser.COSParser.dereferenceCOSObject(COSParser.java:623) 
~[pdfbox-3.0.1.jar:3.0.1]


   at 
org.apache.pdfbox.cos.COSObject.getObject(COSObject.java:121) 
~[pdfbox-3.0.1.jar:3.0.1]


   at 
org.apache.pdfbox.cos.COSDictionary.getDictionaryObject(COSDictionary.java:186) 
~[pdfbox-3.0.1.jar:3.0.1]


   at 
org.apache.pdfbox.cos.COSDictionary.getCOSDictionary(COSDictionary.java:551) 
~[pdfbox-3.0.1.jar:3.0.1]


   at 
org.apache.pdfbox.pdmodel.PDDocument.getDocumentInformation(PDDocument.java:745) 
~[pdfbox-3.0.1.jar:3.0.1]


   at 
org.apache.pdfbox.multipdf.PDFMergerUtility.appendDocument(PDFMergerUtility.java:527) 
~[pdfbox-3.0.1.jar:3.0.1]


   at 
org.apache.pdfbox.multipdf.PDFMergerUtility.legacyMergeDocuments(PDFMergerUtility.java:468) 
~[pdfbox-3.0.1.jar:3.0.1]


   at 
org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:363) 
~[pdfbox-3.0.1.jar:3.0.1]


   at 
org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:343) 
~[pdfbox-3.0.1.jar:3.0.1]


We can’t share the original document of our customer with you, but we 
could manipulate an empty pdf document by inserting the problematic 
object:


14 0 obj

<< /N >>

endobj

I attached the example pdf to my email.

Kind regards,

Ines

---
 >>> business. people. technology. <<<
---

adesso SE mit Sitz in Dortmund
Vorstand: Mark Lohweber (Vors.), Kristina Gerwert,
Andreas Prenneis, Jörg Schroeder, Torsten Wegener
Vorsitzender des Aufsichtsrates: Prof. Dr. Volker Gruhn
Amtsgericht Dortmund HRB 20663

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




Re: FW: PDFBox 3.0.1 Font changes when rendering PDF to Image

2024-01-10 Thread Tilman Hausherr

Hi,

We'd need the PDF file, please upload to a sharehoster. Your attachments 
(all of them) didn't get through.

Also try to use the latest snapshot
https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/3.0.2-SNAPSHOT/
and look at the log messages.
Tilman

On 10.01.2024 13:39, Lisa Moore wrote:


*From:* Lisa Moore
*Sent:* Tuesday, January 9, 2024 10:54 AM
*To:* users-h...@pdfbox.apache.org
*Subject:* PDFBox 3.0.1 Font changes when rendering PDF to Image

Hi,

I am using PDFBox to render a PDF to a .png image.  In the past,  I 
used version 2.0.23 which worked without issue.  When the image is 
rendered in verion 3.0.1, the text part of the PDF document does not 
properly convert the Font (Times Roman).   How can I fix this issue?   
I have attached the images to show the comparison of what is being 
rendered in version 3.0.1 versus 2.0.23.


Thanks for any help you can provide.

Lisa Moore


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




FW: PDFBox 3.0.1 Font changes when rendering PDF to Image

2024-01-10 Thread Lisa Moore


From: Lisa Moore
Sent: Tuesday, January 9, 2024 10:54 AM
To: users-h...@pdfbox.apache.org
Subject: PDFBox 3.0.1 Font changes when rendering PDF to Image

Hi,

I am using PDFBox to render a PDF to a .png image.  In the past,  I used 
version 2.0.23 which worked without issue.  When the image is rendered in 
verion 3.0.1, the text part of the PDF document does not properly convert the 
Font (Times Roman).   How can I fix this issue?   I have attached the images to 
show the comparison of what is being rendered in version 3.0.1 versus 2.0.23.

Thanks for any help you can provide.

Lisa Moore

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

java.io.IOException: Unknown dir object c='>' cInt=62 peek='>' peekInt=62

2024-01-10 Thread John, Ines
Hello PdfBox-Team,

we have the following problem in our project:
When merging documents we get an exception for a certain document. That's why 
we updated the version of pdfBox to 3.0.1. Now we can merge the documents but 
we still get the error in the logfile.
We merge documents by using pdfMergerUtility.mergeDocuments();
Extract from the logfile:
2024-01-10 09:36:34.396 ERROR 11764 --- [pool-1-thread-1] 
org.apache.pdfbox.cos.COSObject  : Can't dereference COSObject{14, 0}
java.io.IOException: Unknown dir object c='>' cInt=62 peek='>' peekInt=62 at 
offset 179966 (start offset: 179966)
   at 
org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:921) 
~[pdfbox-3.0.1.jar:3.0.1]
   at 
org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionaryValue(BaseParser.java:187)
 ~[pdfbox-3.0.1.jar:3.0.1]
   at 
org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionaryNameValuePair(BaseParser.java:347)
 ~[pdfbox-3.0.1.jar:3.0.1]
   at 
org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionary(BaseParser.java:263) 
~[pdfbox-3.0.1.jar:3.0.1]
   at 
org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:882) 
~[pdfbox-3.0.1.jar:3.0.1]
   at 
org.apache.pdfbox.pdfparser.COSParser.parseFileObject(COSParser.java:734) 
~[pdfbox-3.0.1.jar:3.0.1]
   at 
org.apache.pdfbox.pdfparser.COSParser.parseObjectDynamically(COSParser.java:668)
 ~[pdfbox-3.0.1.jar:3.0.1]
   at 
org.apache.pdfbox.pdfparser.COSParser.dereferenceCOSObject(COSParser.java:623) 
~[pdfbox-3.0.1.jar:3.0.1]
   at org.apache.pdfbox.cos.COSObject.getObject(COSObject.java:121) 
~[pdfbox-3.0.1.jar:3.0.1]
   at 
org.apache.pdfbox.cos.COSDictionary.getDictionaryObject(COSDictionary.java:186) 
~[pdfbox-3.0.1.jar:3.0.1]
   at 
org.apache.pdfbox.cos.COSDictionary.getCOSDictionary(COSDictionary.java:551) 
~[pdfbox-3.0.1.jar:3.0.1]
   at 
org.apache.pdfbox.pdmodel.PDDocument.getDocumentInformation(PDDocument.java:745)
 ~[pdfbox-3.0.1.jar:3.0.1]
   at 
org.apache.pdfbox.multipdf.PDFMergerUtility.appendDocument(PDFMergerUtility.java:527)
 ~[pdfbox-3.0.1.jar:3.0.1]
   at 
org.apache.pdfbox.multipdf.PDFMergerUtility.legacyMergeDocuments(PDFMergerUtility.java:468)
 ~[pdfbox-3.0.1.jar:3.0.1]
   at 
org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:363)
 ~[pdfbox-3.0.1.jar:3.0.1]
   at 
org.apache.pdfbox.multipdf.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:343)
 ~[pdfbox-3.0.1.jar:3.0.1]

We can't share the original document of our customer with you, but we could 
manipulate an empty pdf document by inserting the problematic object:
14 0 obj
<< /N >>
endobj
I attached the example pdf to my email.

Kind regards,
Ines

---
 >>> business. people. technology. <<<
---

adesso SE mit Sitz in Dortmund
Vorstand: Mark Lohweber (Vors.), Kristina Gerwert, 
Andreas Prenneis, Jörg Schroeder, Torsten Wegener
Vorsitzender des Aufsichtsrates: Prof. Dr. Volker Gruhn
Amtsgericht Dortmund HRB 20663

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