[jira] [Updated] (PDFBOX-4640) PDF Annotations missed when merging documents

2019-09-02 Thread Tilman Hausherr (Jira)


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

Tilman Hausherr updated PDFBOX-4640:

Attachment: result.pdf

> PDF Annotations missed when merging documents
> -
>
> Key: PDFBOX-4640
> URL: https://issues.apache.org/jira/browse/PDFBOX-4640
> Project: PDFBox
>  Issue Type: Bug
>  Components: Utilities
>Affects Versions: 2.0.16
>Reporter: Daniel Martin Garcia
>Priority: Major
>  Labels: merge
> Attachments: highlighted pdf.pdf, result.pdf
>
>
> Hi,
> There is a bug when PDFBox merges documents with annotations, but the 
> annotation opacity is not 100%. If the opacity is less than 100%, the 
> annotation is lost.
>  
> I attach a document with an annotation which opacity is 60%, if you create a 
> test to merge this pdf with other PDF, the annotation won't be in the merged 
> pdf.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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



[jira] [Commented] (PDFBOX-4640) PDF Annotations missed when merging documents

2019-09-02 Thread Tilman Hausherr (Jira)


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

Tilman Hausherr commented on PDFBOX-4640:
-

{quote}The issue is when you flatten a document with other annotations (and 
their opacity is not 100%), so if we have a document with a PDF Form and other 
kind of annotations, and some of these opacity is less than 100%, PDFBox loses 
them. I think it is a bug.{quote}

That's what you wrote before. Sadly you didn't attach your other PDF, nor did 
you try with the command line utility. Your code is not self-working, some 
variables are not declared.

So I tried to reproduce your alleged bug with this code:
{code}
import java.io.File;
import org.apache.pdfbox.io.MemoryUsageSetting;
import org.apache.pdfbox.multipdf.PDFMergerUtility;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm;

public class PDFBox4640
{
public static void main(String[] args)
{
// create an empty document with 1 empty page (alternatively: load some 
document)
PDDocument document = new PDDocument();
document.addPage(new PDPage());

File sourceFile = new File("highlighted pdf.pdf");

PDFMergerUtility ut = new PDFMergerUtility();
PDDocument sourceDocument = null;
try
{
sourceDocument = PDDocument.load(sourceFile, 
MemoryUsageSetting.setupTempFileOnly());
sourceDocument.getDocumentCatalog().setDocumentOutline(null);
PDAcroForm acroForm = 
sourceDocument.getDocumentCatalog().getAcroForm();
if (acroForm != null)
{
acroForm.flatten();
acroForm.getFields().clear();
}
ut.appendDocument(document, sourceDocument);
document.save("result.pdf");
}

catch (Exception ex)
{

}
}
}
{code}
I have attached the result file. Your annotations are now on page 2 and all 
visible. Your document does not have any acroform.

> PDF Annotations missed when merging documents
> -
>
> Key: PDFBOX-4640
> URL: https://issues.apache.org/jira/browse/PDFBOX-4640
> Project: PDFBox
>  Issue Type: Bug
>  Components: Utilities
>Affects Versions: 2.0.16
>Reporter: Daniel Martin Garcia
>Priority: Major
>  Labels: merge
> Attachments: highlighted pdf.pdf, result.pdf
>
>
> Hi,
> There is a bug when PDFBox merges documents with annotations, but the 
> annotation opacity is not 100%. If the opacity is less than 100%, the 
> annotation is lost.
>  
> I attach a document with an annotation which opacity is 60%, if you create a 
> test to merge this pdf with other PDF, the annotation won't be in the merged 
> pdf.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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



[jira] [Commented] (PDFBOX-4640) PDF Annotations missed when merging documents

2019-09-02 Thread Michael Klink (Jira)


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

Michael Klink commented on PDFBOX-4640:
---

I just flattened your example PDF. Nothing got lost.

You probably should share a minimal compilable example program allowing to 
reproduce the issue.

> PDF Annotations missed when merging documents
> -
>
> Key: PDFBOX-4640
> URL: https://issues.apache.org/jira/browse/PDFBOX-4640
> Project: PDFBox
>  Issue Type: Bug
>  Components: Utilities
>Affects Versions: 2.0.16
>Reporter: Daniel Martin Garcia
>Priority: Major
>  Labels: merge
> Attachments: highlighted pdf.pdf
>
>
> Hi,
> There is a bug when PDFBox merges documents with annotations, but the 
> annotation opacity is not 100%. If the opacity is less than 100%, the 
> annotation is lost.
>  
> I attach a document with an annotation which opacity is 60%, if you create a 
> test to merge this pdf with other PDF, the annotation won't be in the merged 
> pdf.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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



[jira] [Commented] (PDFBOX-4627) Wrong color of uncolored tiling pattern

2019-09-02 Thread Michael Klink (Jira)


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

Michael Klink commented on PDFBOX-4627:
---

Please no qick-fix, though - PDFBox is not only used for rendering but also for 
validation, and in such use cases the invalid instructions *must not be 
dropped*!

> Wrong color of uncolored tiling pattern
> ---
>
> Key: PDFBOX-4627
> URL: https://issues.apache.org/jira/browse/PDFBOX-4627
> Project: PDFBox
>  Issue Type: Bug
>  Components: Rendering
>Affects Versions: 2.0.16
>Reporter: Jiri Kunhart
>Priority: Major
> Attachments: after_fix.png, before_fix.png, 
> uncolored_tiling_pattern.patch, uncolored_tiling_pattern.pdf
>
>
> The attached pdf file with uncolored tiling pattern is rendered wrongly (see 
> "before_fix.png"). The problem is that pattern stream contains
> /DevGrayCS cs
> which overwrites PDPattern color space stored in 
> PDGraphicsState#nonStrokingColor. I did a small fix which ignores all 
> settings of color space inside of uncolored tiling pattern stream and the 
> result seems to be good (see "after_fix.png").
> Note: the pattern in the png file looks diferently than in the original pdf 
> file, but this should be handled probably in the other issue.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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



[jira] [Commented] (PDFBOX-4641) Keywords created using PDFBox are not visible in Acrobat

2019-09-02 Thread Michael Klink (Jira)


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

Michael Klink commented on PDFBOX-4641:
---

The *Keywords* entry in the document information dictionary has been deprecated 
in ISO 32000-2. Chances are, therefore, that in the long run _only_ the XMP 
metadata are of interest.

> Keywords created using PDFBox are not visible in Acrobat
> 
>
> Key: PDFBOX-4641
> URL: https://issues.apache.org/jira/browse/PDFBOX-4641
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.16
> Environment: Windows 7, Eclipse 4.2.2, Acrobat Pro 11.0.10
>Reporter: Gilad Denneboom
>Priority: Minor
> Attachments: ApplyKeywords.java, Keywords test.pdf, Keywords 
> test_added in Acrobat.pdf, Keywords test_edited.pdf
>
>
> Setting new keywords using PDFBox 2.0.16 inserts the data into the file 
> (confirmed via the PDF Debugger and running a script in Acrobat), but the 
> keywords are not displayed in the Acrobat GUI. This might be a bug of Acrobat 
> itself, but it will be good to know why this is happening, and whether it can 
> be solved.
>  
> Attached are a blank sample file created in Acrobat, with no metadata, a java 
> file with the code I used, and the result of running it on that file. When I 
> open the edited file in Acrobat (11.0.10) the Properties window is still 
> empty. However, running the following code from the JS Console does print out 
> the correct output:
> this.info.Keywords
> Output:
> NEW KEYWORDS
>  
> I'm also attaching the same file after I've added keywords to in Acrobat, so 
> the internal structure could be compared with what PDFBox does. I didn't see 
> much of a difference, but maybe I missed something.
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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



[jira] [Comment Edited] (PDFBOX-4640) PDF Annotations missed when merging documents

2019-09-02 Thread Daniel Martin Garcia (Jira)


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

Daniel Martin Garcia edited comment on PDFBOX-4640 at 9/2/19 9:49 AM:
--

Hi Tilman,

The issue is when you flatten a document with other annotations (and their 
opacity is not 100%), so if we have a document with a PDF Form and other kind 
of annotations, and some of these opacity is less than 100%, PDFBox loses them. 
I think it is a bug.


was (Author: dmartinw):
Hi Tilman,

The issue is when you flatten a document with other annotations (and their 
opacity is not 100%), so if we have a document with a PDF Form and other kind 
of annotations, and some of these opacity is less than 100%, PDFBox loses them. 
I think is a bug.

> PDF Annotations missed when merging documents
> -
>
> Key: PDFBOX-4640
> URL: https://issues.apache.org/jira/browse/PDFBOX-4640
> Project: PDFBox
>  Issue Type: Bug
>  Components: Utilities
>Affects Versions: 2.0.16
>Reporter: Daniel Martin Garcia
>Priority: Major
>  Labels: merge
> Attachments: highlighted pdf.pdf
>
>
> Hi,
> There is a bug when PDFBox merges documents with annotations, but the 
> annotation opacity is not 100%. If the opacity is less than 100%, the 
> annotation is lost.
>  
> I attach a document with an annotation which opacity is 60%, if you create a 
> test to merge this pdf with other PDF, the annotation won't be in the merged 
> pdf.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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



[jira] [Commented] (PDFBOX-4640) PDF Annotations missed when merging documents

2019-09-02 Thread Daniel Martin Garcia (Jira)


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

Daniel Martin Garcia commented on PDFBOX-4640:
--

Hi Tilman,

The issue is when you flatten a document with other annotations (and their 
opacity is not 100%), so if we have a document with a PDF Form and other kind 
of annotations, and some of these opacity is less than 100%, PDFBox loses them. 
I think is a bug.

> PDF Annotations missed when merging documents
> -
>
> Key: PDFBOX-4640
> URL: https://issues.apache.org/jira/browse/PDFBOX-4640
> Project: PDFBox
>  Issue Type: Bug
>  Components: Utilities
>Affects Versions: 2.0.16
>Reporter: Daniel Martin Garcia
>Priority: Major
>  Labels: merge
> Attachments: highlighted pdf.pdf
>
>
> Hi,
> There is a bug when PDFBox merges documents with annotations, but the 
> annotation opacity is not 100%. If the opacity is less than 100%, the 
> annotation is lost.
>  
> I attach a document with an annotation which opacity is 60%, if you create a 
> test to merge this pdf with other PDF, the annotation won't be in the merged 
> pdf.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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



[jira] [Commented] (PDFBOX-4627) Wrong color of uncolored tiling pattern

2019-09-02 Thread Jiri Kunhart (Jira)


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

Jiri Kunhart commented on PDFBOX-4627:
--

[~tilman] According to the last Michael's comment it would be worth to fix it. 
I think it is matter of time when other pdfbox user has the same problem (if we 
consider that Amyuni PDF Converter is well know pdf converter and is very often 
used and maybe other pdf converters would generate the same problematic pdf 
file).

> Wrong color of uncolored tiling pattern
> ---
>
> Key: PDFBOX-4627
> URL: https://issues.apache.org/jira/browse/PDFBOX-4627
> Project: PDFBox
>  Issue Type: Bug
>  Components: Rendering
>Affects Versions: 2.0.16
>Reporter: Jiri Kunhart
>Priority: Major
> Attachments: after_fix.png, before_fix.png, 
> uncolored_tiling_pattern.patch, uncolored_tiling_pattern.pdf
>
>
> The attached pdf file with uncolored tiling pattern is rendered wrongly (see 
> "before_fix.png"). The problem is that pattern stream contains
> /DevGrayCS cs
> which overwrites PDPattern color space stored in 
> PDGraphicsState#nonStrokingColor. I did a small fix which ignores all 
> settings of color space inside of uncolored tiling pattern stream and the 
> result seems to be good (see "after_fix.png").
> Note: the pattern in the png file looks diferently than in the original pdf 
> file, but this should be handled probably in the other issue.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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



[jira] [Commented] (PDFBOX-4641) Keywords created using PDFBox are not visible in Acrobat

2019-09-02 Thread Gilad Denneboom (Jira)


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

Gilad Denneboom commented on PDFBOX-4641:
-

Thanks Tilman, that worked. Strange that there's such a parallel way of doing 
it... Maybe it would be a good idea to create a util that will set both things 
at the same time?

> Keywords created using PDFBox are not visible in Acrobat
> 
>
> Key: PDFBOX-4641
> URL: https://issues.apache.org/jira/browse/PDFBOX-4641
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.16
> Environment: Windows 7, Eclipse 4.2.2, Acrobat Pro 11.0.10
>Reporter: Gilad Denneboom
>Priority: Minor
> Attachments: ApplyKeywords.java, Keywords test.pdf, Keywords 
> test_added in Acrobat.pdf, Keywords test_edited.pdf
>
>
> Setting new keywords using PDFBox 2.0.16 inserts the data into the file 
> (confirmed via the PDF Debugger and running a script in Acrobat), but the 
> keywords are not displayed in the Acrobat GUI. This might be a bug of Acrobat 
> itself, but it will be good to know why this is happening, and whether it can 
> be solved.
>  
> Attached are a blank sample file created in Acrobat, with no metadata, a java 
> file with the code I used, and the result of running it on that file. When I 
> open the edited file in Acrobat (11.0.10) the Properties window is still 
> empty. However, running the following code from the JS Console does print out 
> the correct output:
> this.info.Keywords
> Output:
> NEW KEYWORDS
>  
> I'm also attaching the same file after I've added keywords to in Acrobat, so 
> the internal structure could be compared with what PDFBox does. I didn't see 
> much of a difference, but maybe I missed something.
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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



[jira] [Comment Edited] (PDFBOX-4641) Keywords created using PDFBox are not visible in Acrobat

2019-09-02 Thread Tilman Hausherr (Jira)


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

Tilman Hausherr edited comment on PDFBOX-4641 at 9/2/19 6:43 AM:
-

You should add it into the XMP metadata as well, if it exists. (it does here)

See also the {{AddMetadataFromDocInfo.java}} example from the source code 
download.


was (Author: tilman):
You should add it into the XMP metadata as well, if it exists. (it does here)

> Keywords created using PDFBox are not visible in Acrobat
> 
>
> Key: PDFBOX-4641
> URL: https://issues.apache.org/jira/browse/PDFBOX-4641
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.16
> Environment: Windows 7, Eclipse 4.2.2, Acrobat Pro 11.0.10
>Reporter: Gilad Denneboom
>Priority: Minor
> Attachments: ApplyKeywords.java, Keywords test.pdf, Keywords 
> test_added in Acrobat.pdf, Keywords test_edited.pdf
>
>
> Setting new keywords using PDFBox 2.0.16 inserts the data into the file 
> (confirmed via the PDF Debugger and running a script in Acrobat), but the 
> keywords are not displayed in the Acrobat GUI. This might be a bug of Acrobat 
> itself, but it will be good to know why this is happening, and whether it can 
> be solved.
>  
> Attached are a blank sample file created in Acrobat, with no metadata, a java 
> file with the code I used, and the result of running it on that file. When I 
> open the edited file in Acrobat (11.0.10) the Properties window is still 
> empty. However, running the following code from the JS Console does print out 
> the correct output:
> this.info.Keywords
> Output:
> NEW KEYWORDS
>  
> I'm also attaching the same file after I've added keywords to in Acrobat, so 
> the internal structure could be compared with what PDFBox does. I didn't see 
> much of a difference, but maybe I missed something.
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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



[jira] [Commented] (PDFBOX-4641) Keywords created using PDFBox are not visible in Acrobat

2019-09-02 Thread Tilman Hausherr (Jira)


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

Tilman Hausherr commented on PDFBOX-4641:
-

You should add it into the XMP metadata as well, if it exists. (it does here)

> Keywords created using PDFBox are not visible in Acrobat
> 
>
> Key: PDFBOX-4641
> URL: https://issues.apache.org/jira/browse/PDFBOX-4641
> Project: PDFBox
>  Issue Type: Bug
>Affects Versions: 2.0.16
> Environment: Windows 7, Eclipse 4.2.2, Acrobat Pro 11.0.10
>Reporter: Gilad Denneboom
>Priority: Minor
> Attachments: ApplyKeywords.java, Keywords test.pdf, Keywords 
> test_added in Acrobat.pdf, Keywords test_edited.pdf
>
>
> Setting new keywords using PDFBox 2.0.16 inserts the data into the file 
> (confirmed via the PDF Debugger and running a script in Acrobat), but the 
> keywords are not displayed in the Acrobat GUI. This might be a bug of Acrobat 
> itself, but it will be good to know why this is happening, and whether it can 
> be solved.
>  
> Attached are a blank sample file created in Acrobat, with no metadata, a java 
> file with the code I used, and the result of running it on that file. When I 
> open the edited file in Acrobat (11.0.10) the Properties window is still 
> empty. However, running the following code from the JS Console does print out 
> the correct output:
> this.info.Keywords
> Output:
> NEW KEYWORDS
>  
> I'm also attaching the same file after I've added keywords to in Acrobat, so 
> the internal structure could be compared with what PDFBox does. I didn't see 
> much of a difference, but maybe I missed something.
>  



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

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