Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
![]() |
Image Resizing |
Post Reply ![]() |
Author | |
LaGatorVII ![]() Beginner ![]() Joined: 04 Dec 18 Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() Posted: 06 Jul 21 at 6:57PM |
I have a PDF builder application written in C++ Builder 10.3 that uses Debenu PDF Library DLL. The user fills in SQL data and uploads images. I create PDFs using the builder in pieces and then assemble them.
My issue is that with up to 30 .jpg files the resulting PDFs are too large to email. The user has to open each and "optimize" with Adobe. I am looking for a way to automate the optimize process or perhaps resize the images when they are added to the photo PDFs. I am even trying to call all of the available compression routines but they seem to do nothing. Code snippets below. Any help appreciated. Thanks, Gator Code when adding an image to the PDF: DPL.AddImageFromFile(s_image_file.w_str(), 0); DPL.DrawImage(300, 110, 275, 275); DPL.DrawWrappedText(20,120, 270, s_image_desctiption.w_str()); DPL.AddImageFromFile(s_image_file.w_str(), 0); DPL.DrawImage(300, 415, 275, 275); DPL.DrawWrappedText(20,425, 270, s_image_desctiption.w_str()); DPL.CompressContent(); DPL.CompressImages(1); DPL.CompressFonts(1); DPL.SaveToFile(s_live_file.w_str()); This will create a 1 page PDF 2 images per page. I then merge all pages (report and images) together. Code when combining all PDFs (including the one created above) into a single report PDF. DebenuPDFLibraryDLL1611 DPL = DebenuPDFLibraryDLL1611::DebenuPDFLibraryDLL1611(L"DebenuPDFLibraryDLL1611.dll"); BSTR key=L"XXXXXXXXXXXXXXXXXXXXXXXX"; DPL.UnlockKey(key); int i = 0; int i_count = mPDFFileList->Count; while(i<i_count) { DPL.AddToFileList(L"FilesToMerge", mPDFFileList->Strings.w_str()); i++; } if(GetFileAttributesA(AnsiOf(s_diagram.c_str())) != INVALID_FILE_ATTRIBUTES) DPL.AddToFileList(L"FilesToMerge", s_diagram.w_str()); DPL.MergeFileList(L"FilesToMerge", s_full_report.w_str()); |
|
![]() |
|
LaGatorVII ![]() Beginner ![]() Joined: 04 Dec 18 Status: Offline Points: 6 |
![]() ![]() ![]() ![]() ![]() |
Well I didn't get any assistance but in case someone else has this problem. This issue was not with images. The PDFs were inflated by added a true type font.
|
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Robert,
it's important at which code part you're using the compress functionality. Have a look here... perhaps it helps: http://www.quickpdf.org/forum/topic2655_page1.html BTW: Compress will have no influence on jpg cause it's already compressed. |
|
Cheers,
Ingo |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store