[jira] [Updated] (PDFBOX-5225) Flattening removes all annotations when widget annotation has no page

2024-06-28 Thread Tilman Hausherr (Jira)


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

Tilman Hausherr updated PDFBOX-5225:

Attachment: screenshot-1.png

> Flattening removes all annotations when widget annotation has no page
> -
>
> Key: PDFBOX-5225
> URL: https://issues.apache.org/jira/browse/PDFBOX-5225
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.24
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: SourceFailure.pdf, screenshot-1.png
>
>
> {code}
> PDAcroForm acroForm = doc.getDocumentCatalog().getAcroForm();
> List list = new ArrayList<>();
> list.add(acroForm.getField("VN_NAME"));
> acroForm.flatten(list, true); 
> {code}
> The code from buildPagesWidgetsMap that is run when there are widgets with 
> missing page references does not consider the field list. So all widgets end 
> up in the map instead of only those we care about.



--
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] [Updated] (PDFBOX-5225) Flattening removes all annotations when widget annotation has no page

2024-06-28 Thread Tilman Hausherr (Jira)


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

Tilman Hausherr updated PDFBOX-5225:

Description: 
{code}
PDAcroForm acroForm = doc.getDocumentCatalog().getAcroForm();
List list = new ArrayList<>();
list.add(acroForm.getField("VN_NAME"));
acroForm.flatten(list, true); 
{code}
The code from buildPagesWidgetsMap that is run when there are widgets with 
missing page references does not consider the field list. So all widgets end up 
in the map instead of only those we care about.

 !screenshot-1.png! 

  was:
{code}
PDAcroForm acroForm = doc.getDocumentCatalog().getAcroForm();
List list = new ArrayList<>();
list.add(acroForm.getField("VN_NAME"));
acroForm.flatten(list, true); 
{code}
The code from buildPagesWidgetsMap that is run when there are widgets with 
missing page references does not consider the field list. So all widgets end up 
in the map instead of only those we care about.


> Flattening removes all annotations when widget annotation has no page
> -
>
> Key: PDFBOX-5225
> URL: https://issues.apache.org/jira/browse/PDFBOX-5225
> Project: PDFBox
>  Issue Type: Bug
>  Components: AcroForm
>Affects Versions: 2.0.24
>Reporter: Tilman Hausherr
>Priority: Major
> Attachments: SourceFailure.pdf, screenshot-1.png
>
>
> {code}
> PDAcroForm acroForm = doc.getDocumentCatalog().getAcroForm();
> List list = new ArrayList<>();
> list.add(acroForm.getField("VN_NAME"));
> acroForm.flatten(list, true); 
> {code}
> The code from buildPagesWidgetsMap that is run when there are widgets with 
> missing page references does not consider the field list. So all widgets end 
> up in the map instead of only those we care about.
>  !screenshot-1.png! 



--
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] [Updated] (PDFBOX-5846) A PDF with 5.3 million xref data, performance comparison between pdfbox3 and itextpdf.hope to optimize the memory usage and loading process time.

2024-06-28 Thread liu (Jira)


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

liu updated PDFBOX-5846:

Summary: A PDF with 5.3 million xref data, performance comparison between 
pdfbox3 and itextpdf.hope to optimize the memory usage and loading process 
time.  (was: A PDF with 5.3 million xref data, performance comparison between 
pdfbox3 and itextpdf.)

> A PDF with 5.3 million xref data, performance comparison between pdfbox3 and 
> itextpdf.hope to optimize the memory usage and loading process time.
> -
>
> Key: PDFBOX-5846
> URL: https://issues.apache.org/jira/browse/PDFBOX-5846
> Project: PDFBox
>  Issue Type: Improvement
>  Components: Rendering
>Affects Versions: 3.0.2 PDFBox
>Reporter: liu
>Priority: Major
> Attachments: 66.7z, image-2024-06-28-15-49-33-885.png, 
> image-2024-06-28-15-50-36-240.png, image-2024-06-28-15-57-49-634.png, 
> image-2024-06-28-16-00-39-424.png
>
>
> There is a pdf in this compressed file.
> [^66.zip]
>  
> Test comparison code
>  
> {code:java}
> //代码占位符
> package net.qiyuesuo.common.pdf;
> import com.itextpdf.text.pdf.PdfReader;
> import org.apache.pdfbox.Loader;
> import org.apache.pdfbox.io.IOUtils;
> import org.apache.pdfbox.pdmodel.PDDocument;
> import java.io.File;
> /**
>  * @author :  
>  * @description :
>  * @date :
>  */
> public class Test6 {
>private static void pdfbox3() throws Throwable{
>   long l = System.currentTimeMillis();
>   File file = new File("C:\\Users\\LYCIT\\Downloads\\66.pdf");
>   PDDocument pdf = Loader.loadPDF(file, 
> IOUtils.createTempFileOnlyStreamCache());
>   System.out.println("loadPDF time:"+ (System.currentTimeMillis() - l));
>   Thread.sleep(3600);
>}
>public static void itextpdf() throws Throwable {
>   long l = System.currentTimeMillis();
>   String file = "C:\\Users\\LYCIT\\Downloads\\66.pdf";
>   final PdfReader pdfReader = new PdfReader(file, null, true);
>   System.out.println("loadPDF time:"+ (System.currentTimeMillis() - l));
>   Thread.sleep(3600);
>}
>public static void main(String[] args) throws Throwable {
>   pdfbox3();
> //itextpdf();
>}
> }
>  {code}
> Load time:
> pdfbox3:10233 ms.
>  
> itextpdf:925 ms.
> Memory usage:
> pdfbox3:790M.
> !image-2024-06-28-15-49-33-885.png|width=312,height=151!
> itextpdf:106M.
> !image-2024-06-28-15-50-36-240.png|width=307,height=166!
>  
> Detailed memory usage:
> pdfbox3:xrefTable and keyCache.
> !image-2024-06-28-15-57-49-634.png|width=307,height=200!
> itextpdf:xref and xrefObj.
> !image-2024-06-28-16-00-39-424.png|width=311,height=203!
>  



--
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] [Created] (PDFBOX-5846) A PDF with 5.3 million xref data, performance comparison between pdfbox3 and itextpdf.

2024-06-28 Thread liu (Jira)
liu created PDFBOX-5846:
---

 Summary: A PDF with 5.3 million xref data, performance comparison 
between pdfbox3 and itextpdf.
 Key: PDFBOX-5846
 URL: https://issues.apache.org/jira/browse/PDFBOX-5846
 Project: PDFBox
  Issue Type: Improvement
  Components: Rendering
Affects Versions: 3.0.2 PDFBox
Reporter: liu
 Attachments: 66.7z, image-2024-06-28-15-49-33-885.png, 
image-2024-06-28-15-50-36-240.png, image-2024-06-28-15-57-49-634.png, 
image-2024-06-28-16-00-39-424.png

There is a pdf in this compressed file.

[^66.zip]

 

Test comparison code

 
{code:java}
//代码占位符
package net.qiyuesuo.common.pdf;

import com.itextpdf.text.pdf.PdfReader;
import org.apache.pdfbox.Loader;
import org.apache.pdfbox.io.IOUtils;
import org.apache.pdfbox.pdmodel.PDDocument;

import java.io.File;

/**
 * @author :  
 * @description :
 * @date :
 */
public class Test6 {

   private static void pdfbox3() throws Throwable{
  long l = System.currentTimeMillis();
  File file = new File("C:\\Users\\LYCIT\\Downloads\\66.pdf");
  PDDocument pdf = Loader.loadPDF(file, 
IOUtils.createTempFileOnlyStreamCache());
  System.out.println("loadPDF time:"+ (System.currentTimeMillis() - l));
  Thread.sleep(3600);
   }

   public static void itextpdf() throws Throwable {
  long l = System.currentTimeMillis();
  String file = "C:\\Users\\LYCIT\\Downloads\\66.pdf";
  final PdfReader pdfReader = new PdfReader(file, null, true);
  System.out.println("loadPDF time:"+ (System.currentTimeMillis() - l));
  Thread.sleep(3600);
   }

   public static void main(String[] args) throws Throwable {
  pdfbox3();
//itextpdf();
   }
}
 {code}
Load time:
pdfbox3:10233 ms.

 

itextpdf:925 ms.

Memory usage:


pdfbox3:790M.

!image-2024-06-28-15-49-33-885.png|width=312,height=151!
itextpdf:106M.
!image-2024-06-28-15-50-36-240.png|width=307,height=166!


 

Detailed memory usage:

pdfbox3:xrefTable and keyCache.
!image-2024-06-28-15-57-49-634.png|width=307,height=200!

itextpdf:xref and xrefObj.

!image-2024-06-28-16-00-39-424.png|width=311,height=203!

 



--
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