Special markup understood by Apple's pdf viewer

30 views
Skip to first unread message

Aleksy

unread,
Jul 17, 2014, 5:01:36 PM7/17/14
to pdfne...@googlegroups.com

Q: Why do PDFs generated using PDFNet sometimes look different from PDF’s generated using the quartz pdf generator, but only when viewed in an Apple® pdf viewer?

A: Apple has put an additional entry in graphics state of the PDF which signals Apple viewers to force smoothing (anti-aliasing) off. You can get the same effect by adding the Boolean value AAPL:AA = false to the GState of the pdf. This will typically result in shapes having jagged edges (which is minimized or imperceptible with the high resolution screens present on most recent Apple devices), but it will also eliminate tiling artifacts (very thin light-colored lines between shapes).

Q: How do I add this markup using PDFNet?

A: For this type of proprietary markup the only way to change it using PDFNet is via the SDF API:
Something like

page.GetResources().FindObj(“ExtGState”).PutDict(“my_gs”).PutBool(“AAPL::AA”, false);
will set the value for a given page.

To put the resource in the stream you would need to use the low-level

_ElementWriter.WriteString(“ \my_gs gs ”)
_ElementWriter.Flush();

For more info please refer to the API Ref and PDF Spec http://www.pdftron.com/pdfnet/documentation.html

Reply all
Reply to author
Forward
0 new messages