3-Heights™ PDF Toolbox – developer component for PDF processing

The 3-Heights™ PDF Toolbox API is a highly performant, platform independent component for creating and assembling conforming PDF/A documents.

Assemble

Assemble PDF documents from any source

Enrich

Enrich PDF documents with additional information, such as stamps

Create

Create new pages with any content and add them to your PDF documents

PDF Toolbox - Advanced PDF manipulation - edit and composite your PDF documents

PDF toolbox - features

Document assembly

  • Copy pages from existing PDFs
  • Copy annotations, form fields, links, logical structure, destinations, outlines, layers
  • Flatten annotations, form fields, signatures
  • Optimize resources
  • Crop and rotate pages
  • Free composition of content: Overlays, Underlays, Stamps, Transformations
  • Encryption: User password, Owner password, Permissions
  • Copy and modify document metadata
  • Copy and modify page metadata

Content generation

  • Create new PDF content from scratch
  • Apply content to existing pages

Colors

  • Device colors: RGB, CMYK and Grayscale
  • ICC color profiles
  • Transparency: Alpha and Blend mode

Paths

  • Single and Multi-segment lines
  • Rectangle, Circle, Bezier curves, Ellipse, Arc, Pie

Text

  • Font size, Character spacing, Word spacing
  • Enables simple text layouting
  • Standard PDF fonts, installed fonts
  • Unicode characters
  • Text stroke: Line width, Line join and Dashes
  • Fill and stroke text, invisible text
  • Use text as clipping path

Images

  • Bi-level: CCITT G3, G3 2D and G4, Flate, LZW, Packbits, uncompressed
  • 4 bit and 8 bit grayscale: Flate, LZW, Packbits, JPEG and JPEG-6 (8 bit only), uncompressed
  • RGB: Flate, JPEG and JPEG-6, LZW, Packbits, uncompressed

Transformations

  • Translation
  • Scaling
  • Skewing (Horizontal, Vertical)
  • Rotation

Extraction

  • Document information entries: Title, Author, Subject, Keywords, Creator, Producer, Creation date, Modification date
  • Document XMP metadata
  • Page XMP metadata
  • Signature fields: Name, Location, Reason, Contact info, Date, Visibility

Compliance

  • ISO 19005-1 (PDF/A-1)
  • ISO 19005-2 (PDF/A-2)
  • ISO 19885-3 (PDF/A-3)
  • ISO 32000 (PDF 1.7)
Powered by 3-Heights™ Technology and PDF/A compliant

Supported formats

Input formats

  • PDF (Portable Document Format)
  • PDF/A
  • JPEG (Joint Photographic Expert Group)
  • PNG (Portable Network Graphics)
  • GIF (Graphics Interchange Format)
  • BMP (Window Bitmap)
  • JB2 (JBIG2, Joint Bi-level Image Experts Group)
  • JP2 (JPEG2000)
  • JPX (Extended JPEG2000)
  • TIFF (Tagged Image File Format)

Supported font formats

  • Type1
  • TrueType
  • OpenType
  • OpenType(CFF)

Output formats

  • PDF
  • PDF/A
Magnifying lens for our PDF manuals and PDF sample code

MANUAL

API

Areas of use - edit and composite PDF documents

PDF generation

Programmatic creation of any PDF/A-compliant document, whereby its content can stem from any source such as a database or webpage form.

Personalization

PDF documents are used for distributing e-books as well as for creating invoices, contracts and terms and conditions, for instance in insurance application forms. These documents share a common requirement: they need to be supplemented with data specific to the recipient.

Automated reporting

Large quantities of information are stored in databases and DMS systems. PDF Toolbox is designed to receive this information and convert it into distributable standardized PDF documents. It therefore enables the distribution of documents across infrastructures where different technologies and operating systems are in use.

Other areas of use

  • Mass production of invoices, reports, etc.
  • PDF creation "on-the-fly" in web server applications
  • "Save as PDF/A" function in application programs
  • Import images and text in PDF/A documents

#Sample 1 - Add page numbers to a PDF document

Copy a PDF document to a new one and stamp a page number to the bottom of each page in the process.

using System.IO;
using PdfTools;
using PdfTools.Pdf;

namespace PdfToolboxSamples
{
    class AddPageNumbersSample
    {
        /// <summary>
        /// Copies a PDF document to a new document and adds a page number to each page
        /// </summary>
        /// <param name="inFilePath">Path to input PDF document</param>
        /// <param name="outFilePath">Path to resulting PDF document</param>
        public static void AddPageNumbers(string inFilePath, string outFilePath)
        {
            // 1. Initialize input and output documents
            using (Stream outFs = new FileStream(outFilePath, FileMode.Create, FileAccess.ReadWrite))
            using (Document outDoc = Document.Create(outFs, Conformance.Unknown, null))
            using (Stream inFs = new FileStream(inFilePath, FileMode.Open, FileAccess.Read))
            using (Document inDoc = Document.Open(inFs, null))
            {
                // 2. Copy metadata and output intent from input to output document
                outDoc.Metadata = outDoc.CopyMetadata(inDoc.Metadata);
                if (inDoc.OutputIntent != null) outDoc.OutputIntent = outDoc.CopyColorSpace(inDoc.OutputIntent);

                // Initialize page number
                int pageNumber = 1;

                // Create embedded font in output document
                using (Font font = outDoc.CreateSystemFont("Arial", "Bold", true))
                {
                    // 3. Loop through all pages of input document
                    foreach (Page inPage in inDoc.Pages)
                    {
                        // 4. Copy page from input to output document
                        using (Page outPage = outDoc.CopyPage(inPage, CopyOption.CopyLinks | CopyOption.CopyAnnotations | CopyOption.CopyFormFields | CopyOption.CopyOutlines))
                        {
                            // 5. Stamp page number on current page of output document and increase page number
                            AddPageNumberToPage(outDoc, outPage, font, pageNumber++);

                            // 6. Add page to output document
                            outDoc.Pages.Add(outPage);
                        }
                    }
                }
            }
        }

        /// <summary>
        /// Stamps a number to the bottom center of a page in the following format: "Page {pageNumber}"
        /// </summary>
        /// <param name="document">Document that contains page</param>
        /// <param name="page">Page onto which the number will be stamped</param>
        /// <param name="font">Font to use</param>
        /// <param name="number">Number to stamp onto the page</param>
        private static void AddPageNumberToPage(Document document, Page page, Font font, int number)
        {
            // Generate string to be stamped as page number
            string stampString = "Page " + number;

            // Create content generator for appending content to or transforming output page
            using (ContentGenerator contentGenerator = new ContentGenerator(page.Content, false))
            {
                // Create text object
                using (Text text = document.CreateText())
                {
                    // Create text generator with the given font, size and position
                    using (TextGenerator textGenerator = new TextGenerator(text, font, 10, null))
                    {
                        // Calculate position for centering text at bottom of page
                        double x = (page.Size.Width / 2) - (textGenerator.GetWidth(stampString) / 2);
                        double y = 8;

                        // Position the text
                        textGenerator.MoveTo(new Point { X = x, Y = y });

                        // Add page number string
                        textGenerator.Show(stampString);
                    }

                    // Paint the positioned text
                    contentGenerator.PaintText(text);
                }
            }
        }
    }
}
PDF Expert blog - the caveats of assembling PDF/A documents

The caveats of assembling PDF/A documents

Assembling PDF documents from various sources is a crucial part of an output management system. And, as the document needs to be archived in most cases, it should conform to the PDF/A standard. Is there a way to assemble a document and accomplish PDF/A conformance in one step?


PDF Expert Blog - embedded fonts and PDF mass printing application

The problem with embedded fonts in PDF mass printing applications

PDF is more and more finding its way into mass printing applications. However, PDF spool files often ask too much from a print engine resulting in aborts or, even worse, incomplete prints which may not be noticed. What is special about PDF mass printing...