Saves a highly-compressed PDF document to a file on disk.
Copy Code
|
|
---|---|
AT_ERRCOUNT ACCUAPI IG_PDF_save_compressed( HMIGEAR hMPIDoc, LPSTR lpFileName ); |
hMPIDoc | HMIGEAR | A handle to an opened PDF document. |
lpFileName | LPSTR | A file path to save the compressed PDF document. |
The number of ImageGear errors that occurred.
ImageGear for C/C++ improves the overall size of saved PDF documents by reducing or removing data structures in the PDF document, specifically:
WARNING:
File size improvements will vary with each PDF file. In some cases, file size reduction is dramatic. Re-saving an optimized PDF file is not expected to further reduce its size. In rare instances, PDF file size may increase due to metadata that is always written when PDF documents are saved.
C and C++ |
Copy Code
|
---|---|
HMIGEAR pdfDocument; IG_mpi_create(&pdfDocument, 0); IG_mpi_file_open(lpInputFile, pdfDocument, IG_FORMAT_PDF, IG_MP_OPENMODE_READONLY); AT_ERRCOUNT nErr = IG_PDF_save_compressed(document, lpOutputFile); IG_mpi_delete(document); |