Print Page | Close Window

Reduce File Size Code

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=3869
Printed Date: 03 May 24 at 4:36AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Reduce File Size Code
Posted By: Zudokan
Subject: Reduce File Size Code
Date Posted: 10 Dec 20 at 6:22PM
I am pulling out my hair trying to open the sample file and run
"reduce file size" function.

Can someone please post example code of how open file and use
reduce file size?

I have gone through all the searched threads and there is no complete
answer on how to implement this process, just a bunch of discussion
of what it won't do, etc.

Thanks in advance.




Replies:
Posted By: tfrost
Date Posted: 10 Dec 20 at 7:38PM
The best place to start for working samples is the QPDFLibraryDemo program. I see that it does not include a specific sample of the ReduceSize function, but the other scripts in the same Document Management group show how to open, process and save a document.  All you need then is to adapt the sample script to include the ReduceSize function.  Once you have it working in the scripting which you can see and edit in the demo application, you just need to translate the syntax into whatever programming language you use.  And of course add the error handling which tends to be omitted from the sample scripts.  

I do not use this function myself, but maybe other users here could help if we knew the programming language you are using.




Posted By: PeterAnderko
Date Posted: 11 Dec 20 at 7:12AM
Hi Zudokan,

I create example in Delphi:

procedure TForm1.Button7Click(Sender: TObject);
var OKw:Integer;
begin
PDFDok:=TDebenuPDFLibrary1613.Create;
PDFDok.UnlockKey(':-');
PDFDok.LoadFromFile(ExtractFilePath(Application.exeName)+'Test.pdf','');
OKw:=PDFDok.ReduceSize(0);
showmessage(inttostr(OKw));

PDFDok.SaveToFile(ExtractFilePath(Application.exeName)+'ReducedForm.PDF');
PDFDok.Free;
end;



Peter


Posted By: Zudokan
Date Posted: 11 Dec 20 at 4:54PM
Thanks Everyone, problem solved.. appreciate the help.



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