[jira] [Updated] (PDFBOX-5550) reduce number of open files

2022-12-05 Thread Tim Allison (Jira)


 [ 
https://issues.apache.org/jira/browse/PDFBOX-5550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tim Allison updated PDFBOX-5550:

Summary: reduce number of open files  (was: redcuce number of open files)

> reduce number of open files
> ---
>
> Key: PDFBOX-5550
> URL: https://issues.apache.org/jira/browse/PDFBOX-5550
> Project: PDFBox
>  Issue Type: Improvement
>  Components: IO
>Affects Versions: 3.0.0 PDFBox
>Reporter: Andreas Lehmkühler
>Assignee: Andreas Lehmkühler
>Priority: Major
> Fix For: 3.0.0 PDFBox
>
>
> {{org.apache.pdfbox.io.RandomAccessReadBufferedFile}} creates a new instance 
> of {}org.apache.pdfbox.io.RandomAccessReadBufferedFile{} which opens 
> a new file using the underlying file every time when creating a new view. The 
> view of a COSStream isn't most likely closed until the entire pdf is closed. 
> In the end there are as many open files as created COSStreams until the pdf 
> is closed.
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Commented] (PDFBOX-5549) Invisible signature field is not referenced from /Annots dictionary of a Page

2022-12-05 Thread Michael Klink (Jira)


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

Michael Klink commented on PDFBOX-5549:
---

I'm a bit late to the party but as [~bsanchezb] asked, I'll add my 2c anyways, 
essentially summing up what has already been said or implied ;) .

If a signature has a widget annotation, that widget _may_ have a *P* entry 
pointing to the page the widget is associated with. If it has such an entry, 
the *Annots* of that page _must_ point back to the widget. 

Thus, the prior PDFBox behavior was wrong. It could have been fixed by not 
adding a *P* entry to the widgets of invisible signatures or by adding the 
widget to the *Annots* of the page.

The latter option, which has been implemented, might be slightly better for 
interoperability.

But indeed, a software must not rely on a signature field to be referenced from 
a page to be found, it must look into the *AcroForm* form definition.


> Invisible signature field is not referenced from /Annots dictionary of a Page
> -
>
> Key: PDFBOX-5549
> URL: https://issues.apache.org/jira/browse/PDFBOX-5549
> Project: PDFBox
>  Issue Type: Improvement
>  Components: Signing
>Affects Versions: 2.0.27
>Reporter: Aleksandr Beliakov
>Assignee: Tilman Hausherr
>Priority: Minor
> Fix For: 2.0.28, 3.0.0 PDFBox
>
> Attachments: screenshot-1.png, signed.pdf
>
>
> Hello,
>  
> Recently we received a complain about not adding a reference to the newly 
> created signature field to the /Annots array of a page dictionary.
> After analyzing the code, we found that PdfBox dependency used in our 
> project, skips binding of an invisible signature field from a page 
> dictionary. See 
> [PDDocument.java#L455:|https://github.com/apache/pdfbox/blob/2.0.27/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java#L455]
> {code:java}
> if (visualSignature == null) 
> {
> prepareNonVisibleSignature(firstWidget);
> return;
> } {code}
> while adding the signature widget to the given page for visible signature 
> after.
>  
> After analyzing ISO 32000-1/2 I was not able to conclude what is the expected 
> behavior in case of invisible signature. While _/Annots_ array within a page 
> dictionary is optional and shall contain references to annotations associated 
> with a page, the chapter "12.5.2 Annotation dictionaries" also tells "{+}_A 
> given annotation dictionary shall be referenced from the Annots array of only 
> one page._{+}", which is also ambiguous.
> After checking [OpenPDF|https://github.com/LibrePDF/OpenPDF] library, it 
> seems like they associate an invisible signature field with a first page 
> explicitly by providing the reference within /Annots array.
>  
> Could you please give us information about the rational for skipping the 
> invisible signature field from adding into a page's /Annots dictionary and 
> confirm whether the behavior is correct?
>  
> Thank you!
>  
> Best regards,
> Aleksandr.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Commented] (PDFBOX-4892) Improve code quality (4)

2022-12-05 Thread ASF subversion and git services (Jira)


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

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

Commit 1905750 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1905750 ]

PDFBOX-4892: update owasp plugin

> Improve code quality (4)
> 
>
> Key: PDFBOX-4892
> URL: https://issues.apache.org/jira/browse/PDFBOX-4892
> Project: PDFBox
>  Issue Type: Improvement
>Affects Versions: 2.0.20
>Reporter: Tilman Hausherr
>Priority: Minor
>
> This is a longterm issue for the task to improve code quality, by using the 
> [SonarQube report|https://sonarcloud.io/project/issues?id=pdfbox-reactor], 
> hints in different IDEs, the FindBugs tool and other code quality tools.
> This is a follow-up of PDFBOX-4071, which was getting too long.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Commented] (PDFBOX-4892) Improve code quality (4)

2022-12-05 Thread ASF subversion and git services (Jira)


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

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

Commit 1905749 from Tilman Hausherr in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1905749 ]

PDFBOX-4892: update owasp plugin

> Improve code quality (4)
> 
>
> Key: PDFBOX-4892
> URL: https://issues.apache.org/jira/browse/PDFBOX-4892
> Project: PDFBox
>  Issue Type: Improvement
>Affects Versions: 2.0.20
>Reporter: Tilman Hausherr
>Priority: Minor
>
> This is a longterm issue for the task to improve code quality, by using the 
> [SonarQube report|https://sonarcloud.io/project/issues?id=pdfbox-reactor], 
> hints in different IDEs, the FindBugs tool and other code quality tools.
> This is a follow-up of PDFBOX-4071, which was getting too long.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Resolved] (PDFBOX-5549) Invisible signature field is not referenced from /Annots dictionary of a Page

2022-12-05 Thread Tilman Hausherr (Jira)


 [ 
https://issues.apache.org/jira/browse/PDFBOX-5549?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr resolved PDFBOX-5549.
-
  Assignee: Tilman Hausherr
Resolution: Fixed

> Invisible signature field is not referenced from /Annots dictionary of a Page
> -
>
> Key: PDFBOX-5549
> URL: https://issues.apache.org/jira/browse/PDFBOX-5549
> Project: PDFBox
>  Issue Type: Improvement
>  Components: Signing
>Affects Versions: 2.0.27
>Reporter: Aleksandr Beliakov
>Assignee: Tilman Hausherr
>Priority: Minor
> Fix For: 2.0.28, 3.0.0 PDFBox
>
> Attachments: screenshot-1.png, signed.pdf
>
>
> Hello,
>  
> Recently we received a complain about not adding a reference to the newly 
> created signature field to the /Annots array of a page dictionary.
> After analyzing the code, we found that PdfBox dependency used in our 
> project, skips binding of an invisible signature field from a page 
> dictionary. See 
> [PDDocument.java#L455:|https://github.com/apache/pdfbox/blob/2.0.27/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java#L455]
> {code:java}
> if (visualSignature == null) 
> {
> prepareNonVisibleSignature(firstWidget);
> return;
> } {code}
> while adding the signature widget to the given page for visible signature 
> after.
>  
> After analyzing ISO 32000-1/2 I was not able to conclude what is the expected 
> behavior in case of invisible signature. While _/Annots_ array within a page 
> dictionary is optional and shall contain references to annotations associated 
> with a page, the chapter "12.5.2 Annotation dictionaries" also tells "{+}_A 
> given annotation dictionary shall be referenced from the Annots array of only 
> one page._{+}", which is also ambiguous.
> After checking [OpenPDF|https://github.com/LibrePDF/OpenPDF] library, it 
> seems like they associate an invisible signature field with a first page 
> explicitly by providing the reference within /Annots array.
>  
> Could you please give us information about the rational for skipping the 
> invisible signature field from adding into a page's /Annots dictionary and 
> confirm whether the behavior is correct?
>  
> Thank you!
>  
> Best regards,
> Aleksandr.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Commented] (PDFBOX-5549) Invisible signature field is not referenced from /Annots dictionary of a Page

2022-12-05 Thread Aleksandr Beliakov (Jira)


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

Aleksandr Beliakov commented on PDFBOX-5549:


Thanks for fixing! :)

> Invisible signature field is not referenced from /Annots dictionary of a Page
> -
>
> Key: PDFBOX-5549
> URL: https://issues.apache.org/jira/browse/PDFBOX-5549
> Project: PDFBox
>  Issue Type: Improvement
>  Components: Signing
>Affects Versions: 2.0.27
>Reporter: Aleksandr Beliakov
>Priority: Minor
> Fix For: 2.0.28, 3.0.0 PDFBox
>
> Attachments: screenshot-1.png, signed.pdf
>
>
> Hello,
>  
> Recently we received a complain about not adding a reference to the newly 
> created signature field to the /Annots array of a page dictionary.
> After analyzing the code, we found that PdfBox dependency used in our 
> project, skips binding of an invisible signature field from a page 
> dictionary. See 
> [PDDocument.java#L455:|https://github.com/apache/pdfbox/blob/2.0.27/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocument.java#L455]
> {code:java}
> if (visualSignature == null) 
> {
> prepareNonVisibleSignature(firstWidget);
> return;
> } {code}
> while adding the signature widget to the given page for visible signature 
> after.
>  
> After analyzing ISO 32000-1/2 I was not able to conclude what is the expected 
> behavior in case of invisible signature. While _/Annots_ array within a page 
> dictionary is optional and shall contain references to annotations associated 
> with a page, the chapter "12.5.2 Annotation dictionaries" also tells "{+}_A 
> given annotation dictionary shall be referenced from the Annots array of only 
> one page._{+}", which is also ambiguous.
> After checking [OpenPDF|https://github.com/LibrePDF/OpenPDF] library, it 
> seems like they associate an invisible signature field with a first page 
> explicitly by providing the reference within /Annots array.
>  
> Could you please give us information about the rational for skipping the 
> invisible signature field from adding into a page's /Annots dictionary and 
> confirm whether the behavior is correct?
>  
> Thank you!
>  
> Best regards,
> Aleksandr.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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