You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Stefan Ziel (JIRA)" <ji...@apache.org> on 2018/12/12 15:44:00 UTC

[jira] [Comment Edited] (PDFBOX-4399) Printing invisible Content from PDF-Forms

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

Stefan Ziel edited comment on PDFBOX-4399 at 12/12/18 3:44 PM:
---------------------------------------------------------------

To know if an OCG is on or off (depending on the render destination):
# the local properties "Usage/Export/ExportState", "Usage/View/ViewState" (falls back to ExportState), "Usage/Print/PrintState"  (falls back to ExportState) of the OCG
# "/OCProperties/ON" contains enabled OCG's
# "/OCProperties/OFF" contains disabled OCG's
# "/OCProperties/BaseState" 
# "ON" 

From this starting point and the code from C. Alexander Leigh we get the expected result. 



was (Author: jjcool):
Excluding layer "fi" with the code from C. Alexander Leigh we get the expected result. And it seems we must execute the Java code to set the state of the optional content groups.

> Printing invisible Content from PDF-Forms 
> ------------------------------------------
>
>                 Key: PDFBOX-4399
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4399
>             Project: PDFBox
>          Issue Type: Bug
>          Components: AcroForm, Rendering
>    Affects Versions: 2.0.6, 2.0.13
>            Reporter: Stefan Ziel
>            Priority: Major
>              Labels: OCGs
>         Attachments: gs.png, original.pdf, printed.png
>
>
> Printing PDF-documents with macro [^original.pdf] renders hidden content  [^printed.png]  . Code used to print
> {code:java}
> InputStream sourceStream = new FileInputStream(pFile);
> try {
>   PDDocument source = PDDocument.load(sourceStream);
>   job.setPageable(new PDFPageable(source));
>   job.print(atts);
> } finally {
>   sourceStream.close();
> }
> {code}
> This is not only a problem of PDFBox ;) but can be done right ... ghostscript does it [^gs.png].



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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