Overview of how to generate a dynamic PDF File
Creating PDFs programmatically from scratch using Visual Integrity’s PDF Creation SDK is simple. The Crete PDF File API is robust and covers the full spectrum of PDF 2.0 features including images, text strings and labels, form fields, compound objects, layers, line objects, polygons, tooltips and URLs, to name a few. With the PDF Creation API, split, combine, merge, add page numbers, and more.
This example shows how to generate dynamic PDF reports and statements using the API. It’s ideal for applications and services which require PDF output and data-driven PDF creation. Using simple language, create a PDF without any intermediate steps.
Here’s what programmatic PDF creation looks like:
// Create new PDF-file
Vg2Pdf_CreateFile(&pdf, filename, 0);
// Create layers
Vg2Pdf_CreateLayer(&layer1, pdf, “Layer One”, 1);
Vg2Pdf_CreateLayer(&layer2, pdf, “Layer Two”, 1);
// Create new page
Vg2Pdf_BeginPage(pdf, 612.0, 792.0);
// Add a line object to the page
Vg2Pdf_SetStrokeColor(pdf, 128, 0, 255);
pt1.x = 100.0; pt1.y = 600.0;
pt2.x = 200.0; pt2.y = 450.0;
Vg2Pdf_DrawLine(pdf, &pt1, &pt2);
// Enter layer
// Add text object to the page
Vg2Pdf_SetTextFont(pdf, “Calibri”, 0, 12.0);
Vg2Pdf_DrawText(pdf, 100.0, 100.0, 0.0, “Hello World”);
// Close layer
// Add polygon to the page
Vg2Pdf_DrawPoly(pdf, &irpoly, 1);
// Add circle to the page
// Add bezier objectto the page
// Add image to the page
Vg2Pdf_DrawJpgImage(pdf, “hello.jpg”, pts);
// Add tooltip to the page
Vg2Pdf_CreateToolTip(pdf, 1, bbox, “TestToolTip”, “Hello World”);
// Add URL link to the page
Vg2Pdf_CreateURLLink(pdf, 1, bbox, 10.0, 0, “http://www.google.com”);
// End page
// Create 2nd page
Vg2Pdf_BeginPage(pdf, 612.0, 792.0);
// Create link
Vg2Pdf_CreateLink(pdf, 2, bbox, 3, 0, 1, 792.0); /* from page 1 to page 2 */
// Add arc object to page
Vg2Pdf_DrawArc(pdf, 200.0, 300.0, 50.0, 0.0, 270.0);
// End page
// Close the newly created PDF file
Rich, Multi-Platform PDF API for Conversion, Creation and Object Access
Visual Integrity® has upgraded its three PDF SDK’s. Together, the PDF Conversion SDK, PDF Creation SDK and Custom PDF SDK provide a robust, multi-platform, set of PDF libraries for Windows, OS X and Linux developers. The SDK’s can be used to open and edit PDF drawings or diagrams within an application or service, extract text, implement object snapping, and more.
The PDF Conversion SDK enables developers to open and edit vector-based PDF files within their application or web-service. Using two API calls, vector PDF files render as editable objects in target applications, such as CAD programs or Visio. The PDF Conversion SDK also extracts text.
The PDF Creation SDK enables PDF generation as well as actions such as merge, watermark, stamp and extract. PDF files can be created from data, scratch, or from existing files. Content can be added and pages can be combined. Performance is enhanced since, unlike most of today’s converters, pages do not pass through a printer driver.
The Custom PDF SDK gives developers direct control over all the objects and text in a PDF file. It can be used to pre-process PDF files, extract specific objects or change objects before importing. Developers can map their native file format to the Custom PDF SDK allowing them to manipulate layers, implement snapping or change attributes from within their own application.
The Visual Integrity PDF SDK’s are at version 11 and include new API calls and conversion options. These enhancements include:
- New API functions to control scaling, layer separation, file-naming, Unicode support, clipping, password protection, page extraction, image quality and warnings.
- Options to specify fill, change images to color lines and for ellipse rotation.
- Improvements to hidden text functionality, font mapping, Unicode filenames, SVG object styles, EMF kerning, DXF layers, EPS fills, PDF parser and rotation.
Graebert GmbH, leading developer of custom CAD solutions for desktop, mobile and cloud, used Visual Integrity’s Custom PDF SDK to implement snapping in ARES® Commander. They also used the PDF Conversion SDK to build the PDF Import Plugin for Draftsight™.
“Our customers really appreciate the capabilities we’ve added to ARES Commander and DraftSight using Visual Integrity’s PDF Conversion API,” says Robert Graebert, CTO of Graebert GmbH. “Being able to snap to an underlay, or, to open and edit a PDF drawing, are really useful, everyday features.”
D-Tools Inc., the worldwide leader in system integration software, utilizes Visual Integrity’s Conversion SDK in its PDF Cloud Converter, a notable drawing feature in the company’s System Integrator (SI) platform that improves the PDF insert process for its users.
“Visual Integrity’s PDF Conversion SDK enables our customers to generate WMF files within the D-Tools Cloud Converter, and easily insert them directly into Visio while maintaining the drawing scale and high quality vectors of the original file instead of low resolution bitmaps through the standard Visio PDF converter,” said Adam Stone, President and founder of D-Tools. “With support for layers, grouping and scale, it’s helped further streamline the system design and engineering process for our customers, and has working perfectly for over two years and thousands of pages.”
“Our SDK framework has matured to a point where developers can integrate it in less than a day”, said Jean Haney, co-founder and CEO of Visual Integrity, “It’s that easy to meet their customers’ demand to open and edit PDF drawings or to work with PDF objects and text within their own application”.
The Visual Integrity PDF SDK’s are available in two ways – as a perpetual license with optional maintenance or as an annual subscription. Prices for the perpetual license start at $199 while prices for the annual subscription start at $299/year. An evaluation version of the entire PDF developer framework may be downloaded on the Visual Integrity web-site.
About Visual Integrity
Visual Integrity is an early pioneer and leader in PDF and vector graphics technologies. Since 1993, Visual Integrity has been developing solutions to reuse, repurpose and unlock vector-based content such as drawings, diagrams and technical illustrations. The company has turned its 25 years of vector graphics expertise into desktop programs, such as pdf2cad and pdf2picture, as well as a PDF SDK framework for developers and systems integrators including the PDF Conversion SDK, PDF Creation SDK and Custom PDF SDK. Visual Integrity has offices in The Netherlands and Portland, Maine.
Graebert GmbH, with over 30 years of experience in the industry, is recognized as a true innovator in desktop, mobile and cloud CAD solutions. Their “Trinity of CAD™” concept includee multi-platform ARES® Commander for the desktop, ARES Touch™ for smartphones and tablets, and ARES Kudo™, a full browser based solution. Graebert’s OEM CAD engine powers OEM products including Draftsight™ from Dassault Systems, Onshape™ Drawings from OnShape and CorelCAD™ from Corel Corporation. The company, headquartered in Berlin, also has offices in America, Europe and Asia.
D-Tools, Inc., founded in 1998 and based in Concord, California, is a worldwide leader in accessible, highly accurate system design and documentation software platform. The company’s flagship product, System Integrator™ (SI), is a robust solution that utilizes Autodesk® AutoCAD and Microsoft® Visio to facilitate comprehensive system design, documentation and project management. D-Tools enables residential and commercial integrators to streamline business processes and increase revenues while reducing the time and cost associated with the installation and integration of low voltage electronic systems. More than 5,500 leading companies in 87 countries currently use the award-winning D-Tools platform to reduce time, costs and to streamline the system integration process.
Visual Integrity is a registered trademark of Visual Integrity Technologies LLC. All other trademarks and registered trademarks previously cited are the property of their respective owners and are hereby acknowledged.
The Open Design Alliance offers PDF Support and Underlay features based on Visual Integrity’s PDF SDK Libraries. This framework can be extended to add PDF Import/Edit, Creation and Conversion to your application. It can also be used for deep access to PDF object data. ODA Members receive a $500 rebate when extending the ODA PDF platform (PdfModuleVI) to add additional PDF functionality. Members using the PdfiumModule receive a $250 discount when subscribing to any of our PDF SDKs.
Register here for member-only news related to PDF support in The Open Design Alliance Platform.