Re: Problem signing (with LTV) an already signed document with extended features enabled

2022-09-26 Thread Tilman Hausherr
Here's some quick code, replace the beginning of the method "visitFromDictionary(COSDictionary obj)" with it if (!reachedSignature && incrementalUpdate) {     COSBase itemType = obj.getItem(COSName.TYPE);     if (COSName.SIG.equals(itemType) || COSName.DOC_TIME_STAMP.equals(itemType))     {   

Re: Problem signing (with LTV) an already signed document with extended features enabled

2022-09-26 Thread Tilman Hausherr
I'm thinking of adding some code that checks whether it is an "old" signature by comparing it to these huge values that we use (or better, by comparing value[2] + value[3] to the length of the input file). This would then skip these old signatures. Best place would be the segment where "reached

Re: Problem signing (with LTV) an already signed document with extended features enabled

2022-09-26 Thread Patrick Herber
Hi Tilman The signing of this document works without problems. During the signing process of “my” document I have these values: First step: Old signature: byteRangeArray: COSArray{[COSInt{0}, COSInt{1510}, COSInt{13312}, COSInt{382555}]} byteRangeOffset:480058 New signature: byteRan

Re: Problem signing (with LTV) an already signed document with extended features enabled

2022-09-26 Thread Patrick Herber
Hi Maruan Yes, you are right: the document is already signed (with LTV) and when I open it with Acrobat Reader I receive the warning message. The error occurs when I try to add a second signature to it (also with LTV => adding a simple Timestamp (without LTV) works fine). I’m sorry that I can’t

Re: Problem signing (with LTV) an already signed document with extended features enabled

2022-09-26 Thread Patrick Herber
Hi In our case the adding of the new signature is a two step process: 1) The user places his signature image on the document and starts the signature process => at this point we add the signature field at the specified position, we call “saveIncrementalForExternalSigning” and we compute the doc

Re: installing and running PDFBox within Python

2022-09-26 Thread Tres Finocchiaro
Hi, On Mon, Sep 26, 2022 at 4:53 AM Peter Murray-Rust wrote: > TL;DR how to integrate PDFBox into a Python framework for installation and > use by non-computer-scientists? > I did a bit of digging and found the jpype project, which seems to work quite well for basic python->java functionality.

Re: Problem signing (with LTV) an already signed document with extended features enabled

2022-09-26 Thread Tilman Hausherr
Does it happen with this file? https://www.quovadisglobal.com/wp-content/uploads/2020/01/QV_RCA1_RCA3_CPCPS_V4_11.pdf Btw what is byteRangeOffset when calling doWriteSignature() ? In theory this should be the beginning of the actual byte range in the (not yet existing) final PDF. So if this va

Re: Problem signing (with LTV) an already signed document with extended features enabled

2022-09-26 Thread sahy...@fileaffairs.de
Hi, do I understand it correctly that you get an already signed document which when opened causes the Adobe Reader message? You are trying to sign that document a second time? If you can't provide such a document for testing (which would be the best option) I can propably generate such a sampl

Re: Problem signing (with LTV) an already signed document with extended features enabled

2022-09-26 Thread Tilman Hausherr
Hi, How come that you're reaching something COSWriter before saving? And why are saveIncrementalForExternalSigning and saveIncremental called? Is it because you first have the signature, and then the LTV as an extra step? I'm wondering if this code segment     if (incrementalUpdate)   

installing and running PDFBox within Python

2022-09-26 Thread Peter Murray-Rust
TL;DR how to integrate PDFBox into a Python framework for installation and use by non-computer-scientists? I have used PDFBox for at least 10 years and love it and the community. I use it to make (scientific) PDF's semantic, by trapping the events and saving as SVG, after which I can assemble stru

Re: Problem signing (with LTV) an already signed document with extended features enabled

2022-09-26 Thread Patrick Herber
Thanks a lot for your reply! I’ve tried to debug as you suggested. When we “prepare” the document, adding the new signature field before calling the “saveIncrementalForExternalSigning” PDDocument’s method, this segment is reached twice (first for the old signature and second for the new added o