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

Free Support Forum - aspose.com

Problems with layers in IOS

I’m filling in a PDF with ASPOSE. PDF from .NET and believe me it and keeps well, from all browsers and document viewers looks good except in Safari if I try to see from an iPhone or iPad, as I’m seeing, since mobile devices from apple Safari only prints the first layer which is, I would like to know how to merge my pdf to a single layer.
A greeting.

Hi Alvaro,


Thanks for your inquriy. We will appreciate it if you please share your source PDF document here, we will look into the issue and will guide you accordingly.

However to merge PDF layers into a single layer, you can either convert your PDF document to PDFA or convert your PDF document to images and create a new PDF form the images. Please check following sample code snippet for the purpose.

// Option 1<o:p></o:p>

// Convert PDF to PDFA

Aspose.Pdf.Document doc = new Aspose.Pdf.Document("input.pdf");

doc.Convert(new MemoryStream(), PdfFormat.PDF_A_1A, ConvertErrorAction.Delete);

doc.Save("output_pdfa.pdf");

// Option 2

//Convert PDF to images and create a new PDF from the images

// Open document

Aspose.Pdf.Document doc = new Aspose.Pdf.Document("test.pdf");

Aspose.Pdf.Document doc1 = new Aspose.Pdf.Document();

for (int pageCount = 1; pageCount <= doc.Pages.Count; pageCount++)

{

MemoryStream imageStream = new MemoryStream();

Page page = doc1.Pages.Add();

// Create Resolution object

Aspose.Pdf.Devices.Resolution resolution = new Aspose.Pdf.Devices.Resolution(300);

PngDevice pngDevice = new PngDevice(resolution);

// Convert a particular page and save the image to stream

pngDevice.Process(doc.Pages[pageCount], imageStream);

Aspose.Pdf.Image image = new Aspose.Pdf.Image();

image.ImageStream = imageStream;

page.Paragraphs.Add(image);

}

doc1.Save(“output.PDF”);


Best Regards,