pdfDocument.Pages.First().Resources.Images does not list image XObjects referenced using /Alternates, and so far I’ve found no other way of reaching those using Aspose.PDF 188.8.131.52
According to section 184.108.40.206 on page 211 of [the first edition of the PDF reference]
(https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf), an image stored as an XObject can have multiple representations of itself - e.g. one for on-screen display and another for printing with higher resolution - under its /Alternates entry, by referencing an object with an array of alternate image dictionaries.
I managed to create such a PDF file that uses this feature based on the example found on page 212 of said guide, where an alternative image is used for printing.
pdf_alternates_test.pdf (7.5 KB)
I “forged” it in a way so when printed, the text “Printed Image” is shown, as opposed to simply opened, where “Original Image” can be seen, hence it is easy to distinguish which one is used at any moment. I must mention that out of 4 PDF viewers (Chromium, Firefox, Evince, Adobe Acrobat Reader DC) only one managed to actually respect the /Alternates field during print, the others printed the image intended for screen display.
Here is the Acrobat Reader printed version of the file:
printed_adobe.pdf (4.3 KB)
Finally, I tried to reach all the images in this file using the following:
Aspose.Pdf.Document doc = new Aspose.Pdf.Document("pdf_alternates_test.pdf");
foreach (var image in doc.Pages.First().Resources.Images)
However, based on the content size, I could tell that only the on-screen version of the image was listed, and I wasn’t able to access its printed counterpart in any way so far.
All-in-all my questions would be:
- Can the image XObjects under /Alternates be reached in any way using Aspose.Pdf?
- If so, how?
- If not, are there any plans for having that in the future?
You support in this topic would be greatly appreciated!