Is there an easy to use PDF library (C++) to write a sequence of images to a PDF file?

  • 1
    which platform are you on? On Windows you don't need any libraries – phuclv Dec 28 '19 at 3:52

You can do this using LEADTOOLS. (Disclaimer: I am an employee of the vendor of this library).

The following C++ code takes the name of any image file and saves the image into a PDF file. Subsequent calls to this function with different images will append the new images to the same file.

void AppendImageToPdf(TCHAR* pszInputImageName, TCHAR* pszOutputPDF)
   BITMAPHANDLE BmpPage = { 0 };
   L_LoadBitmap(pszInputImageName, &BmpPage, sizeof BITMAPHANDLE, 0, ORDER_BGR, NULL, NULL);
   L_SaveFile(pszOutputPDF, &BmpPage, FILE_RAS_PDF_JPEG_411, 24, 25, SAVEFILE_MULTIPAGE, NULL, NULL, NULL);

There’s a free evaluation (with free tech support) on this page.

| improve this answer | |

ImageMagick CLI would be the easiest, you could trigger a shell execute from C++ using the OS C++ API, or maybe glib if you are on Linux.

Though there is also a C++ library for ImageMagick.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.