English | 日本
c++ pdf
Shopping CartContact Us
PDF code

Create PDF Programs with easyPDF SDK

Quickly and easily build PDF features into your C++ applications

Developers can use easyPDF SDK to quickly and easily build PDF features into their C++ applications.This allows your business to effectively deliver existing business documents to partners, customers and employees.

pdf api

A few lines of code are all it takes to convert a document to PDF in your C++ application:

EasyPDFPrinter::IPrinterPtr oPrinter;
EasyPDFPrinter::IPrintJobPtr oPrintJob = oPrinter->GetPrintJob();
oPrintJob->PrintOut("C:\\input.doc", "C:\\output.pdf");

Comprehensive PDF API Features

BCL easyPDF SDK comes with all the PDF features that you may need in developing C++ applications:


Write C++ Code to Create PDF

C++ Code Snippet for PDF SDK

EasyPDFPrinter::IPrinterPtr oPrinter;
EasyPDFPrinter::IPrintJobPtr oPrintJob = oPrinter->GetPrintJob();
oPrintJob->PrintOut("C:\\input.doc", "C:\\output.pdf");

C++ Sample Projects for PDF SDK


Merge, Split, Extract PDF with C++ Code

  • Read the PDFProcessor Object Specification
    This object lets you do post-processing of existing PDF files (such as merging multiple PDF files into one, splitting one PDF file into two, and encrypting/decrypting a PDF file)

C++ Sample Projects

C++ Code Snippet for Merging PDF Files

EasyPDFProcessor::IPDFProcessorPtr oProcessor;
// merge two files using Merge
oProcessor->Merge("C:\\input1.pdf", "C:\\input2.pdf", "C:\\merged.pdf");
// merge more than two files using MergeBatch  
bound.lLbound = 0;
bound.cElements = 3;
SAFEARRAY *inputFiles = SafeArrayCreate(VT_VARIANT, 1, &bound);
std::string filesToMerge[] = { "C:\\input1.pdf", "C:\\input2.pdf", "C:\\input3.pdf" };
int numFiles = sizeof(filesToMerge) / sizeof(std::string);
_variant_t var;
_variant_t inputArray;
char *file;
_bstr_t str;
long ix;
var.vt = VT_BSTR;
for (int i = 0; i < numFiles; i++)
    ix = i;
    file = const_cast<char *>(filesToMerge[i].c_str());
    str = file;
    var.bstrVal = str;
    SafeArrayPutElement(inputFiles, &ix, &var);
inputArray.vt = VT_ARRAY|VT_VARIANT;
inputArray.parray = inputFiles;
oProcessor->MergeBatch(inputArray, "C:\\merged.pdf");


C++ Code Snippet for Splitting PDF

EasyPDFProcessor::IPDFProcessorPtr oProcessor;
// split the document at page 3
oProcessor->Split("C:\\input.pdf", "C:\\part1.pdf", "C:\\part2.pdf", 3);


C++ Code Snippet for Extracting Text from PDF

EasyPDFProcessor::IPDFProcessorPtr oProcessor;
// extract text from pages 1 through 4 to a physical file using ExtractText
oProcessor->ExtractText("C:\\input.pdf", "C:\\extracted.txt", NULL, 0, 3, NULL, NULL);
// extract text from a bounding box on page 1 to a string variable using ExtractText2
std::string text = oProcessor->ExtractText2("C:\\input.pdf", 0, 0, 0, 300, 300, NULL);


Rasterize PDF with C++ Code

C++ Code Snippet for PDF SDK

EasyPDFConverter::IPDFConverterPtr oConverter;
EasyPDFConverter::IPDF2ImagePtr oPDF2Image = oConverter->GetPDF2Image();
oPDF2Image->Convert("C:\\input.pdf", "C:\\output.jpg", NULL, NULL, NULL);

C++ Sample Projects for PDF SDK


Process PDF Form Fields with C++ Code

C++ Code Snippet for PDF SDK

Download the input.pdf form (highlighted below)

// this example takes the first two fields in a PDF template
// which are Name and Address
// and populates them with values of "BCL Technologies" and "Santa Clara, CA"
EasyPDFDocument::IPDFDocumentPtr oDocument;
// get all form fields from the PDF
EasyPDFDocument::IFormFieldsPtr oFormFields = oDocument->FormFields;
// get the first form field
EasyPDFDocument::IFormFieldPtr oFormField = oFormFields->Item[0];
EasyPDFDocument::ITextFieldPtr oTextField;
if (oFormField->Type == EasyPDFDocument::DOC_FRMTYPE_TEXT && oFormField->Name == _bstr_t("Name"))
	// set Name to "BCL Technologies"
	oTextField = oFormField;
	oTextField->Value = "BCL Technologies";
// get the second form field
oFormField = oFormFields->Item[1];
if (oFormField->Type == EasyPDFDocument::DOC_FRMTYPE_TEXT && oFormField->Name == _bstr_t("Address"))
	// set Address to "Santa Clara, CA"
	oTextField = oFormField;
	oTextField->Value = "Santa Clara, CA";

C++ Sample Projects for PDF SDK



Download Free Trial

Request Pricing

Comprehensive PDF Features
C++ Sample Projects

Download C++ Sample Projects

pdf c++

Testimonials from Our Customers
  • We use easyPDF SDK technology for PDF conversion and it works very well. We knew BCL is a solid company. We have also looked at several competitors and tried to use their products, but we like easy PDF SDK the best. When we talked to BCL Technologies’ design engineering team, we knew they had the knowledge and confidence to solve our problems.” Read the case study
  • We evaluated many PDF tools and drivers. We even wrote our own. Except for BCL’s easyPDF SDK, all had limitations we couldn’t live with. Some only converted from MS Office and not very well. Others could not do annotation or text stamping on PDF documents. None were as easy to use and as easy to integrate.” Read the case study
© 1993 - , BCL Technologies.
All other trademarks are the property of their respective owners.