We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Incorrect pdf rendering Aspose.PDF .net on linux

Hi, im using Aspose.PDF 21.6.0 for .NET for converting pdf to images

In windows all works fine
But on linux i have black rectangle instead of text
In pdf i have text as image with parameters

Stream of type: /XObject
  /BitsPerComponent: 1
  /DecodeParams: 27 0 R -> Dictionary
  /Filter: /CCITTFaxDecode
  /Height: 3220
  /ImageMask: true
  /Length: 28264
  /Subtype: /Image
  /Type: /XObject
  /Width: 1368

I trying to use different devices (PNGDevice, JpegDevice), asposePage.ConvertToPNGMemoryStream(), asposePage.ToImageStream(OCRdpi)
but always have bad result rendering_trouble.jpeg (133.3 KB)
rendering_trouble.jpeg (133.3 KB)

Think trouble is in ImageMask:true on linux

@directum

I request you to explain it little more. Does this happen with every PDF file or a particular one? Share the code which you are using to create images so that we may try to reproduce the same on our end.

@mudassir.fayyaz

This happens NOT with every PDFs, only with PDFs which contains XObjects with ImageMask: true

Here is code

using var document = new Document(pageStream);
var pdfFileName = $"debug/processpage-{Guid.NewGuid()}.pdf";  
document.Save(pdfFileName, SaveFormat.Pdf);// pdf opens correctly with no black rectangles
var asposePage = document.Pages[1];
var imageStream = asposePage.ToImageStream(300);
using var image = System.Drawing.Image.FromStream(imageStream);
image?.Save($"debug/image-{Guid.NewGuid()}.jpg", ImageFormat.Jpeg);

@directum

Can you please share a sample PDF file so that we may proceed further with investigation on our end.

waybill.pdf (107.8 KB)

@directum

We are checking the issue on our end and will get back to as soon as possible.

How is it going?

@jwpark3

We have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as PDFNET-51407. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.