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

Tilman Hausherr edited comment on PDFBOX-5966 at 3/8/25 10:36 AM:
------------------------------------------------------------------

PDFBox issue.

Page 4 is special: it has segments that render properly and one that doesn't. 
Here's some reduced files:  [^PDFBOX-5966-p4-reduced-good.pdf]  
[^PDFBOX-5966-p4-reduced-bad.pdf] [^PDFBOX-5966-p4-reduced-bad2.pdf] 

Sadly, the "good" file is uses a completely different strategy for the same 
color, so it won't help us.


was (Author: tilman):
PDFBox issue.

Page 4 is special: it has segments that render properly and one that doesn't. 
Here's some reduced files:  [^PDFBOX-5966-p4-reduced-good.pdf]  
[^PDFBOX-5966-p4-reduced-bad.pdf] 

Sadly, the "good" file is uses a completely different strategy for the same 
color, so it won't help us.

> Rendered PDF is missing shading pattern graphics
> ------------------------------------------------
>
>                 Key: PDFBOX-5966
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5966
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.33, 3.0.4 PDFBox
>            Reporter: Roderick McMullen
>            Priority: Minor
>         Attachments: PDFBOX-5966-p4-reduced-bad.pdf, 
> PDFBOX-5966-p4-reduced-bad2.pdf, PDFBOX-5966-p4-reduced-good.pdf, 
> issuedFilePDF.pdf, issuedFilePDF.pdf-page1.png, 
> screen-capture-issuedFilePDF-page1-acrobatreader.png
>
>
> Rendering pages from [^issuedFilePDF.pdf] (e.g. first page) results in 
> missing shading pattern behind the line numbers.
> Expected: [^screen-capture-issuedFilePDF-page1-acrobatreader.png]
> Actual: [^issuedFilePDF.pdf-page1.png]
> Code:
> {code:java}
> byte[] fileBytes = Files.readAllBytes(Paths.get(pdfPath));
> DataInputStream data = new DataInputStream(new 
> ByteArrayInputStream(fileBytes));
> try (PDDocument pdfboxDocument = PDDocument.load(data)) {
>   PDFRenderer renderer = new PDFRenderer(pdfboxDocument);
>   renderer.setImageDownscalingOptimizationThreshold(0.2f);
>   BufferedImage bim = renderer.renderImageWithDPI(pageIndex, 72, 
> ImageType.RGB);
>   File outputFile = new File(pngPath);
>   ImageIO.write(bim, "png", outputFile);
> }
> {code}
> Is this incorrect pdfbox usage, or is this a pdfbox issue?



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

Reply via email to