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

[jira] [Comment Edited] (PDFBOX-4399) Disabled optional content groups are rendered

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

Tilman Hausherr edited comment on PDFBOX-4399 at 12/15/18 1:31 PM:
-------------------------------------------------------------------

[~jjcool] thank you; I noticed that you make the assumption than rendering to graphics = print. This is wrong, see the demo code in PDFBOX-3359. So there should be a different way to pass this. The simplest way that comes into my mind is to set it like {{subsamplingAllowed}}. The default should be VIEW. So PDFPrintable should also be changed so that it passes PRINT. Could you please change that and resubmit?

[~lehmi] does the code look like Stefan used your advice from 2016? Which was
{quote}We need to track the current layer and the stack of all current layers. C. provided some code doing that and we already have some code doing it (I'm talking about the operators in org.apache.pdfbox.contentstream.operator.markedcontent). What is missing is some sort of filter based on that information.{quote}



was (Author: tilman):
[~jjcool] thank you; I noticed that you make the assumption than rendering to graphics = print. This is wrong, see the demo code in PDFBOX-3359. So there should be a different way to pass this. The simplest way that comes into my mind is to set it like {{subsamplingAllowed}}. The default should be EXPORT. So PDFPrintable should also be changed so that it passes PRINT. Could you please change that and resubmit?

[~lehmi] does the code look like Stefan used your advice from 2016? Which was
{quote}We need to track the current layer and the stack of all current layers. C. provided some code doing that and we already have some code doing it (I'm talking about the operators in org.apache.pdfbox.contentstream.operator.markedcontent). What is missing is some sort of filter based on that information.{quote}


> Disabled optional content groups are rendered
> ---------------------------------------------
>
>                 Key: PDFBOX-4399
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4399
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.6, 2.0.13
>            Reporter: Stefan Ziel
>            Priority: Major
>              Labels: OCGs
>             Fix For: 2.0.14, 3.0.0 PDFBox
>
>         Attachments: PDFBOX-4399.patch, gs.png, original.pdf, printed.png
>
>
> Printing  a Documents with hidden optional content groups [^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