Some test text!

Info dictionary

Information dictionary: adding custom data to a PDF in PHP

To add custom data to an existing document.

// In case you have PDFDoc you can always access
// SDF/Cos document using PDFDoc.GetSDFDoc() method
$doc = new SDFDoc($filename);
$trailer = $doc->GetTrailer(); // Get the trailer

// Create an Info dictionary
$info = $trailer->PutDict("Info");
$info->PutString("Producer", "PDFTron PDFNet");

// Create a custom inline dictionary within Info dictionary
$custom_dict = $info->PutDict("My Direct Dict");
$custom_dict->PutNumber("My Number", 100);

Cos/SDF low-level API to edit PDF files
Full code sample which illustrates how to use basic Cos/SDF API to edit an existing document.

Get the answers you need: Support

Upcoming Webinar: Customer Experience and Retaining Control: Boosting Document Automation and Efficiency in Financial Services | Sept 15, 2022 at 11 am PT


The Platform


© 2022 PDFTron Systems Inc. All rights reserved.


Terms of Use