You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Frank Zhou (Jira)" <ji...@apache.org> on 2022/05/18 20:43:00 UTC

[jira] [Updated] (PDFBOX-5438) Blurry PDF results from Tif Conversion

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

Frank Zhou updated PDFBOX-5438:
-------------------------------
    Description: 
When converting a tif/tiff file to a pdf using PDImageXObject, we noticed that the final result could be completely or partially blurry sometimes. It happens on our server hosted on the cloud randomly but never happens on the server that runs on the local machine (laptop).

What could be the causes for this rendering issue, and could you help us with any suggestive actions we could take to investigate further and resolve the issue? We can't attach the result file because it contains our customer information.

Thanks for your understanding, and we appreciate your help and support!

 
{code:java}
// Tiff -> PDF conversion
final ImageReader reader = iterator.next();
reader.setInput(imageInputStream);
final int numPages = reader.getNumImages(true);

for (int i = 0; i < numPages; i++) {
    final BufferedImage bufferedImage = reader.read(i);
    final PDRectangle pageSize =
            new PDRectangle(bufferedImage.getWidth(), bufferedImage.getHeight());
    final PDPage page = new PDPage(pageSize);
    document.addPage(page);
    PDImageXObject pdImageXObject =
            LosslessFactory.createFromImage(document, bufferedImage);
    PDPageContentStream content = new PDPageContentStream(document, page);
    content.drawImage(
            pdImageXObject,
            0,
            0,
            page.getMediaBox().getWidth(),
            page.getMediaBox().getHeight());
    content.close();
}

ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
document.save(byteArrayOutputStream);
document.close();
return byteArrayOutputStream.toByteArray(); {code}

  was:
When converting a tif/tiff file to a pdf using PDImageXObject, we noticed that the final result could be completely or partially blurry sometimes. It happens on our server hosted on the cloud randomly but never happens on the server that runs on the local machine (laptop).

What could be the causes for this rendering issue, and could you help us with any suggestive actions we could take to investigate further and resolve the issue? We can't attach the result file because it contains our customer information.

Thanks for your understanding, and we appreciate your help and support!

 


> Blurry PDF results from Tif Conversion
> --------------------------------------
>
>                 Key: PDFBOX-5438
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5438
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.24
>            Reporter: Frank Zhou
>            Priority: Major
>         Attachments: PartialBlurryResult.png
>
>
> When converting a tif/tiff file to a pdf using PDImageXObject, we noticed that the final result could be completely or partially blurry sometimes. It happens on our server hosted on the cloud randomly but never happens on the server that runs on the local machine (laptop).
> What could be the causes for this rendering issue, and could you help us with any suggestive actions we could take to investigate further and resolve the issue? We can't attach the result file because it contains our customer information.
> Thanks for your understanding, and we appreciate your help and support!
>  
> {code:java}
> // Tiff -> PDF conversion
> final ImageReader reader = iterator.next();
> reader.setInput(imageInputStream);
> final int numPages = reader.getNumImages(true);
> for (int i = 0; i < numPages; i++) {
>     final BufferedImage bufferedImage = reader.read(i);
>     final PDRectangle pageSize =
>             new PDRectangle(bufferedImage.getWidth(), bufferedImage.getHeight());
>     final PDPage page = new PDPage(pageSize);
>     document.addPage(page);
>     PDImageXObject pdImageXObject =
>             LosslessFactory.createFromImage(document, bufferedImage);
>     PDPageContentStream content = new PDPageContentStream(document, page);
>     content.drawImage(
>             pdImageXObject,
>             0,
>             0,
>             page.getMediaBox().getWidth(),
>             page.getMediaBox().getHeight());
>     content.close();
> }
> ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
> document.save(byteArrayOutputStream);
> document.close();
> return byteArrayOutputStream.toByteArray(); {code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

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