10.07.2015 Views

Download - Multivac!

Download - Multivac!

Download - Multivac!

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

quired, but will enhance the quality of the generated Tagged PDF output and are thereforerecommended.Table 9.20 Operations which are recommended for generating Tagged PDFitemhyphenationword boundariesartifactsType 3 fontpropertiesinteractive elementsRecommended PDFlib functions and options for Tagged PDF compatibilityWord breaks (separating words in two parts at the end of a line) should be presented using a softhyphen character (U+00AD) as opposed to a hard hyphen (U+002D)Words should be separated by space characters (U+0020) even if this would not strictly be requiredfor positioning. The autospace parameter can be used for automatically generating spacecharacters after each call to one of the show functions.In order to distinguish real content from page artifacts, artifacts should be identified as such usingPDF_begin_item( ) with tag=Artifact.The familyname, stretch, and weight options of PDF_begin_font( ) should be supplied with reasonablevalues for all Type 3 fonts used in a Tagged PDF document.Interactive elements, e.g. links, should be included in the document structure and made accessibleif required, e.g. by supplying alternate text. The tab order for interactive elements can be specifiedwith the taborder option of PDF_begin/end_document( ) (this is not necessary if the interactiveelements are properly included in the document structure).Prohibited operations. Table 9.21 lists all operations which are prohibited when generatingTagged PDF output. Calling one of the prohibited functions while in Tagged PDFmode will trigger an exception.Table 9.21 Operations which must be avoided when generating Tagged PDFitemnon-Unicodecompatible fontsPDF importPDFlib operations to be avoided for Tagged PDF compatibilityFonts which are not Unicode-compatible according to Section 5.4.4, »Unicode-compatible Fonts«,page 111, must be avoided.Pages from PDF documents which contain structure information (in particular: Tagged PDF documents)must not be imported.9.6.2 Creating Tagged PDF with direct Text Output and TextflowsMinimal Tagged PDF sample. The following sample code creates a very simplisticTagged PDF document. Its structure tree contains only a single P element. The code usesthe autospace feature to automatically generate space characters between fragments oftext:if (p.begin_document("hello-tagged.pdf", "tagged=true") == -1)throw new Exception("Error: " + p.get_errmsg());/* automatically create spaces between chunks of text */p.set_parameter("autospace", "true");/* open the first structure element as a child of the document structure root (=0) */id = p.begin_item("P", "Title={Simple Paragraph}");p.begin_page_ext(0, 0, "width=a4.width height=a4.height");font = p.load_font("Helvetica-Bold", "unicode", "");218 Chapter 9: Generating various PDF Flavors

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!