[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-12-11 Thread Maruan Sahyoun (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15741075#comment-15741075
 ] 

Maruan Sahyoun commented on PDFBOX-3396:


This fixes the remaining issues for [^Signed-Document-1.pdf] and 
[^Signed-Document-2.pdf] which are now rendered identical before and after 
flattening.

[~Shinobi75] if you like please test with the latest version. I hope that this 
resolves not only the files provided but others you have. I'm closing this 
issue as we are about to release {{2.0.4}}. Further issues and enhancements 
should be tracked in a new issue. If the issue is not resolved for the files 
you already provided we can reopen this ticket. But please don't attach new 
ones.

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Assignee: Maruan Sahyoun
>Priority: Critical
> Fix For: 2.0.4, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.flatten.20160912.pdf, Signed-Document-3.pdf, 
> Signed-Document-4.pdf, Signed-Document-Flattened-1.pdf, 
> Signed-Document-Flattened-2.pdf, Signed-Document-Flattened-3+4.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document-Image-Printed.pdf, 
> Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-12-11 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15741067#comment-15741067
 ] 

ASF subversion and git services commented on PDFBOX-3396:
-

Commit 1773739 from [~msahyoun] in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1773739 ]

PDFBOX-3396: dont applay a transformation if the PDFormXObject has a BBox not 
starting at 0,0

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Assignee: Maruan Sahyoun
>Priority: Critical
> Fix For: 2.0.4, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.flatten.20160912.pdf, Signed-Document-3.pdf, 
> Signed-Document-4.pdf, Signed-Document-Flattened-1.pdf, 
> Signed-Document-Flattened-2.pdf, Signed-Document-Flattened-3+4.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document-Image-Printed.pdf, 
> Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-12-11 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15741058#comment-15741058
 ] 

ASF subversion and git services commented on PDFBOX-3396:
-

Commit 1773738 from [~msahyoun] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1773738 ]

PDFBOX-3396: dont applay a transformation if the PDFormXObject has a BBox not 
starting at 0,0

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Assignee: Maruan Sahyoun
>Priority: Critical
> Fix For: 2.0.4, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.flatten.20160912.pdf, Signed-Document-3.pdf, 
> Signed-Document-4.pdf, Signed-Document-Flattened-1.pdf, 
> Signed-Document-Flattened-2.pdf, Signed-Document-Flattened-3+4.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document-Image-Printed.pdf, 
> Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-12-11 Thread Maruan Sahyoun (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15739409#comment-15739409
 ] 

Maruan Sahyoun commented on PDFBOX-3396:


[~lehmi] two of the sample files are fine now with only minimal differences. 
There is still one issue common in 2 other files for the location of the 
signature image. I hope to be able to fix that today otherwise I'll postpone to 
2.0.5.

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Assignee: Maruan Sahyoun
>Priority: Critical
> Fix For: 2.0.4, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.flatten.20160912.pdf, Signed-Document-3.pdf, 
> Signed-Document-4.pdf, Signed-Document-Flattened-1.pdf, 
> Signed-Document-Flattened-2.pdf, Signed-Document-Flattened-3+4.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document-Image-Printed.pdf, 
> Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-12-09 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15736228#comment-15736228
 ] 

ASF subversion and git services commented on PDFBOX-3396:
-

Commit 1773459 from [~msahyoun] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1773459 ]

PDFBOX-3396, PDFBOX-3587: add unit test to compare rendering before and after 
flattening. Individual test disabled per default.

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Assignee: Maruan Sahyoun
>Priority: Critical
> Fix For: 2.0.4, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.flatten.20160912.pdf, Signed-Document-3.pdf, 
> Signed-Document-4.pdf, Signed-Document-Flattened-1.pdf, 
> Signed-Document-Flattened-2.pdf, Signed-Document-Flattened-3+4.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document-Image-Printed.pdf, 
> Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-12-09 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15736162#comment-15736162
 ] 

ASF subversion and git services commented on PDFBOX-3396:
-

Commit 1773458 from [~msahyoun] in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1773458 ]

PDFBOX-3396, PDFBOX-3587: always translate the appearance, apply scaling if the 
appearance is using an XForm

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Assignee: Maruan Sahyoun
>Priority: Critical
> Fix For: 2.0.4, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.flatten.20160912.pdf, Signed-Document-3.pdf, 
> Signed-Document-4.pdf, Signed-Document-Flattened-1.pdf, 
> Signed-Document-Flattened-2.pdf, Signed-Document-Flattened-3+4.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document-Image-Printed.pdf, 
> Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-12-09 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15736076#comment-15736076
 ] 

ASF subversion and git services commented on PDFBOX-3396:
-

Commit 1773457 from [~msahyoun] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1773457 ]

PDFBOX-3396, PDFBOX-3587: always translate the appearance, apply scaling if the 
appearance is using an XForm

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Assignee: Maruan Sahyoun
>Priority: Critical
> Fix For: 2.0.4, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.flatten.20160912.pdf, Signed-Document-3.pdf, 
> Signed-Document-4.pdf, Signed-Document-Flattened-1.pdf, 
> Signed-Document-Flattened-2.pdf, Signed-Document-Flattened-3+4.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document-Image-Printed.pdf, 
> Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-12-06 Thread Maruan Sahyoun (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15725192#comment-15725192
 ] 

Maruan Sahyoun commented on PDFBOX-3396:


I'm currently working on that as well as on PDFBOX-3587 which is somehow 
related. Should be resolved by the end of the week.

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Assignee: Maruan Sahyoun
>Priority: Critical
> Fix For: 2.0.4, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.flatten.20160912.pdf, Signed-Document-3.pdf, 
> Signed-Document-4.pdf, Signed-Document-Flattened-1.pdf, 
> Signed-Document-Flattened-2.pdf, Signed-Document-Flattened-3+4.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document-Image-Printed.pdf, 
> Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-12-06 Thread JIRA

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15725164#comment-15725164
 ] 

Andreas Lehmkühler commented on PDFBOX-3396:


[~msahyoun] Any chance to get this done for 2.0.4, or should we postpone?

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Assignee: Maruan Sahyoun
>Priority: Critical
> Fix For: 2.0.4, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.flatten.20160912.pdf, Signed-Document-3.pdf, 
> Signed-Document-4.pdf, Signed-Document-Flattened-1.pdf, 
> Signed-Document-Flattened-2.pdf, Signed-Document-Flattened-3+4.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document-Image-Printed.pdf, 
> Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-09-22 Thread Fabio (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15513728#comment-15513728
 ] 

Fabio commented on PDFBOX-3396:
---

Hi Maruan,
I've tryed the 2.0.4 version. It's ok to fix the new Issue but, as you just 
say, it doesn't fit very well for the position of the signature image after 
flattening. For me that situation it's ok, because after some attempts, I've 
changed strategy. Now, I'm using the PDFRenderer class of PDFBox to convert 
each page of a signed file into a compress image(the file 
'Signed-Document-Image-Printed.pdf' just uploaded is an example). With this 
technique, every signature image appear and remain in the correct position. The 
size of the printed pdf is big, but for us that isn't a real problem. For me, 
you can close the reopened issue. Thank you very much for you patience, time, 
great job and attention about my issues.

Best regardes,
Fabio.

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Assignee: Maruan Sahyoun
>Priority: Critical
> Fix For: 2.0.4, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.flatten.20160912.pdf, Signed-Document-3.pdf, 
> Signed-Document-4.pdf, Signed-Document-Flattened-1.pdf, 
> Signed-Document-Flattened-2.pdf, Signed-Document-Flattened-3+4.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document-Image-Printed.pdf, 
> Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-09-13 Thread Maruan Sahyoun (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15488386#comment-15488386
 ] 

Maruan Sahyoun commented on PDFBOX-3396:


I have to move it to 2.0.4 as I'm not able to complete the tests and implement 
the special handling for Signed-Document.pdf. BTW two other libs I've tested 
have also issues with the correct position of the signature image after 
flattening, so this seems to be a very special case.  

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Assignee: Maruan Sahyoun
>Priority: Critical
> Fix For: 2.0.4, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.flatten.20160912.pdf, Signed-Document-3.pdf, 
> Signed-Document-4.pdf, Signed-Document-Flattened-1.pdf, 
> Signed-Document-Flattened-2.pdf, Signed-Document-Flattened-3+4.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-09-13 Thread Fabio (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15488034#comment-15488034
 ] 

Fabio commented on PDFBOX-3396:
---

Hi Maruan,
Thank you forse  your great job!
I'm currently out of the office for  a  my  personal travel.
I'll backup in office next  monday and I'll feedback you  about  my  test on 
new 2.0.3 versione. 

Thank you very much for your attention!
I'll write you sono. 

Best regards,
Fabio.

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Assignee: Maruan Sahyoun
>Priority: Critical
> Fix For: 2.0.3, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.flatten.20160912.pdf, Signed-Document-3.pdf, 
> Signed-Document-4.pdf, Signed-Document-Flattened-1.pdf, 
> Signed-Document-Flattened-2.pdf, Signed-Document-Flattened-3+4.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-09-12 Thread Maruan Sahyoun (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15485091#comment-15485091
 ] 

Maruan Sahyoun commented on PDFBOX-3396:


I've managed to improve the result for [^Signed-Document-3.pdf] but at the cost 
of a no longer as expected result for [^Signed-Document.pdf]. This is due to 
the fact that there is already a translation for the signature image in 
Signed-Document.pdf (3 levels up in the content stream so not directly to be 
found) so in that special case there shouldn't be a translation applied. I'd 
also need to test the results for regular fields.

If I manage to make it in time I'll only apply the changes to 2.0.3 as working 
on it there are other potential issues which I'd like to address in a future 
release (e.g. the current code processes per field where it should process per 
page to correctly handle the pages graphics state).

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Assignee: Maruan Sahyoun
>Priority: Critical
> Fix For: 2.0.3, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.flatten.20160912.pdf, Signed-Document-3.pdf, 
> Signed-Document-4.pdf, Signed-Document-Flattened-1.pdf, 
> Signed-Document-Flattened-2.pdf, Signed-Document-Flattened-3+4.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-08-05 Thread Fabio (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15408953#comment-15408953
 ] 

Fabio commented on PDFBOX-3396:
---

Thank you very much for your attention and patience.

Best regards,
Fabio Evangelista

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Assignee: Maruan Sahyoun
>Priority: Critical
> Fix For: 2.0.3, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.pdf, Signed-Document-4.pdf, 
> Signed-Document-Flattened-1.pdf, Signed-Document-Flattened-2.pdf, 
> Signed-Document-Flattened-3+4.pdf, Signed-Document-Flattened.pdf, 
> Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-08-04 Thread Maruan Sahyoun (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15408879#comment-15408879
 ] 

Maruan Sahyoun commented on PDFBOX-3396:


I was able to reproduce the issue. As I'm currently on travel it will be 
another day or two to fix the issue.

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Assignee: Maruan Sahyoun
>Priority: Critical
> Fix For: 2.0.3, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.pdf, Signed-Document-4.pdf, 
> Signed-Document-Flattened-1.pdf, Signed-Document-Flattened-2.pdf, 
> Signed-Document-Flattened-3+4.pdf, Signed-Document-Flattened.pdf, 
> Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-08-03 Thread Fabio (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15405900#comment-15405900
 ] 

Fabio commented on PDFBOX-3396:
---

Hello,
Is there someone could help me, with the reopen situation of that issue?
Sorry, but I've got that problem in a production environment, and I'm very 
preoccupied about the right resolution of the issue.

Thank you very much for any support.

Best regards,
Fabio Evangelista

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Priority: Critical
> Fix For: 2.0.3, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.pdf, Signed-Document-4.pdf, 
> Signed-Document-Flattened-1.pdf, Signed-Document-Flattened-2.pdf, 
> Signed-Document-Flattened-3+4.pdf, Signed-Document-Flattened.pdf, 
> Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-08-01 Thread Fabio (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15401862#comment-15401862
 ] 

Fabio commented on PDFBOX-3396:
---

Hallo,
 I've attached files:

1-Signed-Document-3.pdf and Signed-Document-4.pdf are examples of an original 
signed documents before flattaning.

2-Signed-Document-Flattened-3+4.pdf is an example of a printout document after 
flattaning process(the flattened files are the second and third page of the 
file).

Thank you for your support.


> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Priority: Critical
> Fix For: 2.0.3, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-3.pdf, Signed-Document-4.pdf, 
> Signed-Document-Flattened-1.pdf, Signed-Document-Flattened-2.pdf, 
> Signed-Document-Flattened-3+4.pdf, Signed-Document-Flattened.pdf, 
> Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-07-04 Thread Fabio (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15361456#comment-15361456
 ] 

Fabio commented on PDFBOX-3396:
---

Maruan,
Thank you very much for your work, support and code revisions too!

Best regards,
Fabio Evangelista.


> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Priority: Critical
> Fix For: 2.0.3, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-Flattened-1.pdf, Signed-Document-Flattened-2.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-07-04 Thread Maruan Sahyoun (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15361411#comment-15361411
 ] 

Maruan Sahyoun commented on PDFBOX-3396:


I've also looked at above code which can be shortened to

{code}
PDDocument pdDoc = PDDocument.load("signed-document.pdf");
PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
PDAcroForm acroForm = pdCatalog.getAcroForm();
acroForm.flatten();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
pdDoc.save(baos);
{code}

specifically the following lines are not ideal
{code}
pfs.getAcroForm().flatten();
pfs.getAcroForm().refreshAppearances();
{code}

# after the first {{pfs.getAcroForm().flatten()}} there are no more fields and 
as a result subsequent calls do not make any sense
# {{pfs.getAcroForm().refreshAppearances()}} should be done prior to 
{{flatten()}} if you want to make sure that all appearances were properly 
generated by PDFBox (which you don't need to do at all if the form filling 
application already took care of). Calling it after {{flatten()}} wouldn't have 
any effect as there are no more fields.

Please also note that appearance generation is always specific by the filling 
application as the details of the look & feel are not part of the PDF 
specification. In addition PDFBox support for appearance generation of 
signature fields.

If you would only like to flatten specific fields use 
{{PDAcroForm.flatten(List boolean refreshAppearances)}} instead.


> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Priority: Critical
> Fix For: 2.0.3, 2.1.0
>
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-Flattened-1.pdf, Signed-Document-Flattened-2.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-07-04 Thread Maruan Sahyoun (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15361402#comment-15361402
 ] 

Maruan Sahyoun commented on PDFBOX-3396:


that's either {{2.0.3-SNAPSHOT}} or {{2.1.0-SNAPSHOT}} like this:

{code}

  org.apache.pdfbox
  pdfbox
  2.0.3-SNAPSHOT

{code}

no specific release dates have been set yet for the final versions.

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Priority: Critical
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-Flattened-1.pdf, Signed-Document-Flattened-2.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-07-04 Thread Fabio (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15361152#comment-15361152
 ] 

Fabio commented on PDFBOX-3396:
---

Maruan, 
I'm happy! :-) everything is fine now, with your new version of PDAcroForm.java 
file!
I've just built a new version of the pdfbox-2.0.2.jar from branch 
'pdfbox/branches/2.0' and use the new jar 
with my existing code and everything works fine!
I've attached some files from my last tests:

1-Signed-Document-1.pdf and Signed-Document-2.pdf are examples of originals 
signed documents before flattening.

2-Signed-Document-Flattened-1.pdf and Signed-Document-Flattened-2.pdf are 
examples of a printout documents after flattening process(the flattened file is 
the second page of the file).

Now, my flattened files are OK!
Thank you very much for your precious support.

Now, which Maven version of the artifact should I use, to fix the problem in my 
production environment?

Best regards,
Fabio.


> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Priority: Critical
> Attachments: Signed-Document-1.pdf, Signed-Document-2.pdf, 
> Signed-Document-Flattened-1.pdf, Signed-Document-Flattened-2.pdf, 
> Signed-Document-Flattened.pdf, Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-07-04 Thread Fabio (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15360938#comment-15360938
 ] 

Fabio commented on PDFBOX-3396:
---

Maruan, 
thank you very much for your work!
I'll try soon the new artifact, in both of versions that you indicate.
I'll then, notify to you the results of my tests.

Best regards,
Fabio.

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Priority: Critical
> Attachments: Signed-Document-Flattened.pdf, Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-07-04 Thread Maruan Sahyoun (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15360909#comment-15360909
 ] 

Maruan Sahyoun commented on PDFBOX-3396:


[~Shinobi75] I've checked in the changes to 2.0.3 and 2.1.0 which should be 
available later today. Could you verify if it works for you.

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Priority: Critical
> Attachments: Signed-Document-Flattened.pdf, Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-07-04 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15360905#comment-15360905
 ] 

ASF subversion and git services commented on PDFBOX-3396:
-

Commit 1751214 from [~msahyoun] in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1751214 ]

PDFBOX-3396: don't add a transformation if there is a XObject

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Priority: Critical
> Attachments: Signed-Document-Flattened.pdf, Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-07-04 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15360892#comment-15360892
 ] 

ASF subversion and git services commented on PDFBOX-3396:
-

Commit 1751213 from [~msahyoun] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1751213 ]

PDFBOX-3396: don't add a transformation if there is a XObject

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Priority: Critical
> Attachments: Signed-Document-Flattened.pdf, Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-06-30 Thread Fabio (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15356796#comment-15356796
 ] 

Fabio commented on PDFBOX-3396:
---

Ohthank you!
Very nice to listen this... :-)

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Priority: Critical
> Attachments: Signed-Document-Flattened.pdf, Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-06-30 Thread Maruan Sahyoun (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15356757#comment-15356757
 ] 

Maruan Sahyoun commented on PDFBOX-3396:


Yes, I've something in the works which I hope to be able to commit tonight.

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Priority: Critical
> Attachments: Signed-Document-Flattened.pdf, Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> {code}
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
> {code}
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
> {code}
>pfs.getAcroForm().flatten();
> {code}
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-06-30 Thread Fabio (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15356652#comment-15356652
 ] 

Fabio commented on PDFBOX-3396:
---

Hallo,
have you got something new about that problem?

Thank you for your support and patience.

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Priority: Critical
> Attachments: Signed-Document-Flattened.pdf, Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
>   
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
>pfs.getAcroForm().flatten();
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-06-23 Thread Fabio (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15346516#comment-15346516
 ] 

Fabio commented on PDFBOX-3396:
---

Hallo,
i've attached files:

1-Signed-Document.pdf is an example of an original signed document before 
flattaning.

2-Signed-Document-Flattened.pdf is an example of a printout Document after 
flattaning process(the flattened file is the second page of the file).

Thank you for your support.


> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Priority: Critical
> Attachments: Signed-Document-Flattened.pdf, Signed-Document.pdf
>
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
>   
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
>pfs.getAcroForm().flatten();
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Commented] (PDFBOX-3396) flattaning AcroForm with visible sign field ETSI.CAdES.detached

2016-06-23 Thread Maruan Sahyoun (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-3396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15346491#comment-15346491
 ] 

Maruan Sahyoun commented on PDFBOX-3396:


would it be possible to attach a sample PDF?

> flattaning AcroForm with visible sign field ETSI.CAdES.detached
> ---
>
> Key: PDFBOX-3396
> URL: https://issues.apache.org/jira/browse/PDFBOX-3396
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.1, 2.0.2
> Environment: Java 8 - Spring Boot
>Reporter: Fabio
>Priority: Critical
>
> Hallo,
> I've got a problem with the flattaning function of AcroForm class of a 
> PDSignatureField. I've a signed pdf document with ETSI.CAdES.detached visible 
> image at bottom of the file. I want to flattan the PDSignatureField of the 
> sign to eliminate sign cryptography element of the field and to embad the 
> sign marker immage of the sign, in the same position of the original immage 
> that is a part of the marker sign ETSI.CAdES.detached. I try this way(pseudo 
> code similare to real code):
> PDDocument pdDoc = PDDocument.load("signed-document.pdf");
> PDDocumentCatalog pdCatalog = pdDoc.getDocumentCatalog();
> PDAcroForm acroForm = pdCatalog.getAcroForm();
> List fields = acroForm.getFields();
> fields.stream().filter(pf -> 
> pf.getFieldType().toLowerCase().contains("sig")).forEach(pf -> {
> try {
>   PDSignatureField pfs = ((PDSignatureField)(pf));
>   
>log.info("START remove Sign Flags");
>pfs.setReadOnly(true);
>pfs.setRequired(false);
>pfs.setNoExport(true);
>log.info("END remove Sign Flags");
>
>log.info("START flatten field");
>pfs.getAcroForm().flatten();
>pfs.getAcroForm().refreshAppearances();
>log.info("END flatten field");
>   
> } catch (Exception ex) {
>log.error("flattenFile --> Error: " + ex.getMessage());
>throw new RuntimeException(ex);
> }
> });
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> pdDoc.save(baos);
> .
> .
> .
>   
> At the and of the process, the pdf file in output, has no sign cryptography 
> element, but the visible marker immage of the sign is placed in a wrong 
> position, on top of sign above paragraph of the document and not in original 
> position of the signed marker immage. That's happen when i call the following 
> method:
>pfs.getAcroForm().flatten();
> In other words, the flattened pdf of the original signed pdf, has in a 
> correct way no more sign inside but, the immage of the ETSI.CAdES.detached 
> signe is embedded in a wrong position, over the text of the nearest above 
> paragraph of the pdf document.
> My questions are: 
> 1-My way, is the correct way to flattan a signed ETSI.CAdES.detached file?
> 2-Is there a method to remove CadES/PadES sign with a official visible marker 
> image and, embad immage in the acctual original position in pdf file?
> Thank you for your support and sorry for my poor English.
> Best regards,
> Fabio Evangelista



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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