0

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

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

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.

https://imagemagick.org/www/script/magick++.php

0

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);
   L_FreeBitmap(&BmpPage);
}

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

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.