PDFlib
PDFlib

All Topics Overview

Block Handling and PPS

block_below_contents

Fill PDFlib blocks so that they are placed below the imported page.

business_cards

Output an imported PDF page several times, with its blocks being filled with different personalized data.

clone_blocks

Clone Blocks from another document. Use POCA to copy a modified Block.

create_blocks_with_poca

Create PDFlib Blocks with the POCA interface.

duplicate_block

Duplicate a PDFlib block to any number of pages.

fill_converted_formfields

Output an imported PDF page with its blocks being filled with different personalized data.

linked_textblocks

Link multiple Textflow blocks

nested_blocks

Create nested blocks.

override_block_rectangle

Fill some blocks of an imported PDF page while changing the rectangle coordinates.

query_block_color

Query the background color of blocks.

query_block_properties

Import a PDF page containing blocks, and query various block properties.

starter_block

Import a PDF page containing blocks, and process all blocks.

Color

colorAll_for_cropmarks

Create crop marks which will be visible on all color separations, using the special color "All".

color_gradient

Fill some area or text with a smooth transition from one color to another.

iccprofile_to_image

Assign an ICC profile to an image.

recombine_color_channels

colorizes images and places all colorized images on top of each other.

spot_color

Define and use several spot colors.

starter_color

Demonstrate the basic use of supported color spaces.

web_colornames

View a list of all cross-browser colors including the color name and hexadecimal color value as well as the corresponding RGB color values used in PDFlib.

Complex Scripts

arabic_formatting

Arabic formatting issues

bidi_formatting

How to create several variants of Bidi output

gajij_eudc

Demonstrates the use of SING and EUDC fonts for merging a Gaiji character into an existing font

starter_shaping

Demonstrates text shaping for Arabic, Hebrew, Devanagari, and Thai scripts. Right-to-left text is reordered according to the Bidi algorithm.

Document Interchange

control_nexpress_trays

For NexPress digital color printing machines, create some special kind of annotations to control the input tray.

embed_xmp

Embed custom XMP metadata in a document.

import_xmp_from_pdf

Retrieve the XMP metadata from an imported document and write all document-level XMP metadata to the output PDF.

Fonts and Encodings

barcode_font

Output text in a barcode font.

character_references

Demonstrate the usefulness of character references, using a suitable font.

escape_sequences

Use escape sequences in text lines to output octal or hexadecimal values.

font_info

Get various properties of a font such as font name, font style, or encoding.

font_metrics_info

Get various font related metrics such as the ascender or descender.

font_resources

Configure font resources and search for fonts.

glyph_availability

Check the availability of glyphs in a font.

glyph_replacement

Show the effects of glyph substitution in case of glyphs missing in the font.

opentype_features_for_cjk

Demonstrate the use of OpenType features for CJK fonts and text.

opentype feature tester

Demonstrate all supported typographic OpenType features after checking whether a particular feature is supported in a font.

retain_font

Performance benefits of keeping a font open across multiple documents.

simulated_fontstyles

Create simulated italic or bold text output.

starter_fallback

Starter sample for fallback fonts

starter_opentype

Demonstrate various typographic OpenType features after checking whether a particular feature is supported in a font.

starter_type3font

Create a simple Type 3 font from vector data.

type3_bitmaptext

Create a simple Type 3 font from image data.

type3_rasterlogo

Create a Type 3 font which contains a single logo derived from an image.

type3_subsetting

Demonstrate Type 3 font definition, use, and subsetting.

type3_turkish_character

Create a Type 3 font by cloning another font and adding a further glyph

type3_vectorlogo

Create a Type 3 font which contains a single logo derived from a vector based PDF page.

General Programming

aes256_unicode_password

Produce an AES-256-encrypted document with a master password that contains Thai characters and ligatures.

error_handling

Demonstrate different strategies with respect to exception handling.

initial_view

Define the initial viewing properties for a document, such as zoom, page number, navigation tab, or title bar.

license_key

Apply your PDFlib license key using various methods to get rid of the demo stamp.

metric_topdown_coordinates

Output text using metric coordinates in a topdown coordinate system.

permission_settings

Change the permission settings so that only commenting the PDF is allowed.

repeated_contents

Create contents which are used identically on multiple pages, such as fixed headers or footers.

starter_basic

Create some simple text, vector graphics and image output.

starter_pvf

Create a PVF file which holds an image or PDF, and import the data from the PVF file.

Geospatial PDF

starter_geospatial

Import an image with a map and add geospatial reference information

Graphics

aligned_path_objects

Path object like an arrow, electrical symbol etc. is attached at a line by an attachment point and with an alignment.

arrows

Create an arrow using different methods.

arrow_as_path_object

Example for a path object: An arrow with rounded arrow head, with two attachment points.

clipping

Demonstrate the effect of the different PDF clipping rules.

crop_marks

Create crop marks which specify the "cutting area".

dashed_lines

Create some dash patterns to be used as line styles.

fill_pattern

Define some hatching patterns and use them to fill arbitrary shapes.

fill_rules

Define some overlapping vector graphics and fill them using various methods.

hierarchical_layers

Define a layer hierarchy using the parent and child options.

layers_and_bookmarks

Define two layers and hide or show them via bookmarks.

overprinting_text

Create text which will overprint other page contents instead of knocking it out.

path_objects

Create various shapes with path objects

rounded_rectangle

Create some rectangle with the corners being rounded.

softmask

Create a soft mask based on arbitrary geometric objects.

stamp_on_print_layer

Place a stamp on a layer which is only visible upon printing.

starter_graphics

Create some basic examples of vector graphics.

starter_layer

Define several layers, output images and text into them and define particular layers to be visible when opening the document.

starter_path

Starter sample for path objects: Create some basic examples of path object construction and use

starter_svg

Load SVG graphics and fit into a box.

transparent_graphics

Create some transparent graphics objects.

Images

add_opi_info

Attach OPI information to an image.

align_text_at_image

Align text at an image.

alpha_channel

Demonstrates the use of an integrated alpha channel in TIFF and/or PNG images.

center_image_on_card

Place an image on an imported PDF card.

display_image_partially

Display an image partially.

frame_around_image

Draw a frame around an image.

image_dimensions

Get the dimensions of an image for various purposes.

image_from_url

Read an image from an URL and place it in a PDF document.

image_mask

Place an image with a mask applied to it.

image_rounded_corners

Place an image with rounded corners.

integrated_clipping_path

Place an image with its integrated clipping path being applied to it.

multi_page_tiff

Convert an input TIFF image containing one or more frames to PDF.

starter_image

Load and place an image using various options for scaling and positioning.

tiling_pattern

Define a tiling pattern containing an image and use it to cover the page background with tiles.

transparent_images

Create transparent images.

Interactive Elements

acrobat_menu_items

Upon opening the page, create a full list of all menu item names in Acrobat.

barcode_field

Create the three types of barcode fields that Acrobat supports.

form_and_layers

Define two layers for English or German contents and hide or show them via form field buttons.

form_checkbox

Create four form fields of type "checkbox".

form_combobox

Create a form field of type "combobox" for choosing an item from a list or changing an existing item.

form_listbox

Create a form field of type "listbox" for choosing an item from a list.

form_multiline_textfield

Create a form field of type "textfield" for entering multiline text.

form_pushbutton

Create two form fields of type "pushbutton" for executing the "Print" and "Save As" commands.

form_radiobutton

Create a field group with three form fields of type "radiobutton".

form_tab_order

Define the position of each form field in the tab order, i.e. when the user presses the "Tab" key.

form_textfield_fill_with_js

Fill a form text field with a value using JavaScript.

form_textfield_height

Determine the height of a form field of type "textfield" with respect to the font size and vice versa.

form_textfield_input_check

Check if the date entered in a form field of type "textfield" has been formatted correctly.

form_textfield_input_format

Format the data entered in a form field of type "textfield" according to the rules defined.

form_textfield_layout

Specify the layout of a form field of type "textfield" for displaying a date.

form_triggers_js_actions

Demonstrate all possibilities to trigger a JavaScript action from a form field.

link_annotations

On images and text lines, create links to open PDF files or Web pages, or to execute a JavaScript.

movie_annotations

Demonstrate the use of a movie annotation in PDF.

nested_bookmarks

Create bookmarks which are nested in several levels.

portfolio_navigator

Package multiple PDF and other documents into a PDF portfolio. Import a custom navigator.

starter_portfolio

Package multiple PDF and other documents into a PDF portfolio.

triggers_for_javascript_actions

Demonstrate all possibilities to trigger a JavaScript action (except of form fields).

Multimedia

javascript_for_3d_animation

Load a PRC 3D model and animate it with JavaScript.

javascript_for_3d_camera

JavaScript for 3D camera: Load a PRC 3D model and align camera with JavaScript.

starter_3d

Create a 3D model and load it into a U3D annotation.

starter_flash

Embed Flash in PDF

Pagination

crop_page

Crop an A4 page to an A5 page.

reverse_page_order

Create pages in reverse page order.

insert_toc

Create some pages, assign labels to them and insert a table of contents at the beginning of the document.

page_sizes

Create some pages with various page sizes.

page_x_of_y

Create a running footer "Page x of y" on each page of the document.

PDF/A

clone_pdfa

Clone PDF/A and PDF/X standard documents

images_to_pdfa2b

Convert grayscale, CMYK or RGB image files in TIFF or JPEG formats to PDF/A-2b, taking care of color space issues.

pdfa2a_invoice

Combined PDF/UA-1 and PDF/A-2a invoice generation demo.

pdfa_extension_schema

Demonstrate the use of an XMP extension schema as defined in PDF/A-1.

pdf_extension_schema_with_type

Demonstrate the use of a complex XMP extension schema as defined in PDF/A-1.

starter_pdfa1b

Create a PDF/A-compliant output.

starter_pdfa2b

Create PDF/A-2b conforming output with layers, transparency and PDF/A attachments.

text_to_pdfa2b

Output text conforming to PDF/A-2b, taking care of color space and font issues.

transparent_stamp_for_pdfa1

Apply a transparent stamp to an existing PDF/A-1 document while maintaining PDF/A-1 conformance.

zugferd_invoice

Create a PDF/A-3b ZUGFeRD invoice from scratch.

zugferd_add_xml_to_pdfa

ZUGFeRD: Add XML Invoice to PDF

PDF/UA

clone_pdfua

Clone PDF/A, PDF/UA and PDF/X standard documents.

merge_and_stamp_pdfua

Merge PDF/UA documents including the document structure trees. Additional text is stamped onto each page and tagged as Artifact.

starter_pdfua1

Create PDF/UA-1 document with various content types including structure elements, artifacts, and interactive elements.

tag_out_of_order

This topic demonstrates how to create Tagged PDF out of order.

tag_parallel_columns

This topic demonstrates how to tag multiple columns in parallel with activate_item().

tagged_form_fields

Create accessible form field according to PDF/UA.

tagged_invoice

Combined PDF/UA-1 and PDF/A-2a invoice generation demo.

tagged_list

Demonstrate list tagging

tagged_pdf_with_textflow

Create a Tagged PDF containing a Textflow with appropriate structure elements on several pages.

tagged_scan_with_ocr_text

Tagging for invisible OCR text which accompanies a scanned page.

tagged_table

Demonstrate automatic table tagging.

PDF/VT

starter pdfvt1

Create a large number of invoices in a single PDF and make use of PDF/VT-1 features.

starter pdfvt2

Create a large number of invoices in a single PDF and make use of PDF/VT-2 features.

starter pdfvt2s

This variation of the starter_pdfvt2 wraps the data into a PDF/VT-2s-compliant MIME package, according to ISO 16612-2:2010 specification, Annex A

PDF/X

 

clone_pdfx

Clone PDF/A and PDF/X standard documents

starter_pdfx3

Create a PDF/X-3-compliant output.

starter_pdfx4

Create PDF/X-4 conforming output with layer variants and transparency

starter_pdfx5g

Create PDF/X-5g conforming output with a reference to an external page

PDF Import

clone_page_boxes

Clone the ArtBox, TrimBox, BleedBox, CropBox, and MediaBox entries of an imported PDF page.

crop_imported_pages

Crop the pages of an existing PDF document.

import_in_reverse_order

Read the pages of an input PDF document and output them in reverse order.

import_pages_into_layers

Import two pages and output them on two layers on the same page.

import_repeated_contents

In order to keep the output file size as small as possible handles to imported PDF pages or images can and should be reused for repeated contents.

split_document

Split PDF document in separate output documents where each output document contains a range of one or more pages from the input document.

import_pages_into_layers

Import two pages and output them on two layers on the same page.

starter_pdfmerge

Merge pages from multiple PDF documents.

starter_pcos

Dump information from an existing PDF document.

rotate_pages

Rotate the pages of an existing PDF document.

stamp_pages

Place a stamp on the pages of an existing PDF document.

pdfimpose

Import all pages from one or more existing PDFs, and place c x r pages on each sheet of the output PDF (imposition).

scale_down_imported_pages

Place A4 pages from an imported PDF as A5 pages in the output document.

PDF on the Web Server

starter_webform

Create a linearized PDF which is encrypted and contains some form fields.

Tables

table_row_height

Define the height of the rows in a table.

nested_tables

Place a sub-table in one table cell.

fit_formfield_into_cell

Fit a form field into a table cell, e.g. to create a pushbutton in the cell.

colorize_cells

Provide some table cells with a colored background.

mixed_table_contents

Demonstrate how to place various kinds of contents in table cells spanning one or more columns or rows.

repeat_cell_contents

Show how table cell contents will be repeated on the next table instance if a cell or a row is split.

spread_oversized_table

Output a table on 2 x m pages as it is needed to fit it completely.

spread_text_over_cells

Use the continue option of add_table_cell() to continue a Textflow in another cell.

starter_table

Create table which may span multiple pages.

table_contact_sheet

Create a contact sheet with photos and their labels.

table_invoice

Create an invoice using the table feature.

table_rotated_text

Create a table containing rotated text.

table_schedule

Create a weekly booking plan for the meeting rooms of a company.

table_timesheet

Create a monthly time sheet for the working hours of an employee.

vertical_text_alignment

Demonstrate the vertical alignment of text lines and Textflows in a table cell.

Text Output

create_interactive_index

In a Textflow define some terms to be indexed and create a sorted index from the indexed terms.

vertical_alignment_in_fitbox

Control the vertical alignment of text in the fitbox.

keep_lines_together

Control the lines kept together on the page.

drop_caps

Create an initial drop cap at the beginning of some text.

distance_between_paragraphs

Control the distance between adjacent paragraphs.

avoid_linebreaking

Create a Textflow and define various options for line breaking.

bulleted_list

Output numbered and bulleted lists.

continue_note_after_text

Insert a dot sequence automatically at the end of a textflow fitbox after the last word which can be showed together with the dots completely inside the fitbox.

current_text_position

Demonstrate how the current text position can be used to output simple text, text lines, or Textflows next to one another.

dot_leaders_with_tabs

Use leaders to fill the space defined by tabs between left-aligned and right-aligned text, such as in a table of contents.

footnotes_in_text

Create footnotes (superscript text) in a Textflow provided with links to jump to the footnote text.

image_as_text_fill_color

Create outline text and fill the interior of the glyphs with an image.

invisible_text

Output invisible text on top of an image.

leaders_in_textline

Use dot leaders to fill the space between text and a page number such as in a table of contents.

numbered_list

Output numbered lists with the numbers left- or right-aligned.

process_utf8

Read text in the UTF-8 format and output it.

rotated_text

Create text output which does not run  horizontally, but at some angle.

shadowed_text

Create a shadowed text line with the shadow option of fit_textline.

simple_stamp

Create a stamp across the page which runs diagonally from one edge to the other.

starter_textflow

Create multi-column text output which may span multiple pages.

starter_textline

Demonstrate various options for placing a text line.

tabstops_in_text

Create a simple multi-column layout using tab stops.

text_as_clipping_path

Output text filled with an image.

text on a path

Create text on a path.

text_on_color

Place a text line and a Textflow on a colored background.

text_with_image_clipping_path

Use the clipping path from a TIFF or JPEG image to shape text output.

transparent_part_of_text

Use gstate in Textflow, e.g. for transparency/opacity

transparent_text

Create some transparent text.

underlined_text

Create underlined text.

weblink_in_text

Create a Textflow and integrate colorized Web links in the text.

wrap_text_around_images

Place images within a Textflow.

wrap_text_around_polygons

Use arbitrary polygons as wrapping shapes for text to wrap around.