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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Image Resizing
  FAQ FAQ  Forum Search   Register Register  Login Login

Image Resizing

 Post Reply Post Reply
Author
Message
LaGatorVII View Drop Down
Beginner
Beginner


Joined: 04 Dec 18
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote LaGatorVII Quote  Post ReplyReply Direct Link To This Post Topic: Image Resizing
    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());

Back to Top
LaGatorVII View Drop Down
Beginner
Beginner


Joined: 04 Dec 18
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote LaGatorVII Quote  Post ReplyReply Direct Link To This Post 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.  
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store