Print Page | Close Window

Image Resizing

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3934
Printed Date: 18 Apr 24 at 3:43AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Image Resizing
Posted By: LaGatorVII
Subject: Image Resizing
Date 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());




Replies:
Posted By: LaGatorVII
Date Posted: 09 Nov 21 at 1:03PM
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.  


Posted By: Ingo
Date Posted: 09 Nov 21 at 7:14PM
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




Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk