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!
Add image to PDF File with "DAOpenFile" |
Post Reply |
Author | |
Amelie
Beginner Joined: 10 Nov 17 Location: France Status: Offline Points: 13 |
Post Options
Thanks(0)
Posted: 02 Jun 23 at 7:10PM |
hi, Delphi : I access a PDF file with "DAOpenFile" . I want to add an image to this PDF file then save it with another name with "DASaveAsFile". I wrote the following code but it creates a PDF file with an empty page with the image. Here is my code: var QuickPDF: TDebenuPDFLibrary; FileHandle : Integer; begin try QuickPDF := TDebenuPDFLibrary.Create ; QuickPDF.UnlockKey(edtLicenseKey.Text) ; FileHandle := QuickPDF.DAOpenFile('D:\MyPDF_file.pdf', ''); QuickPDF.AddImageFromFile('D:\Myimage.png',2); QuickPDF.DrawImage(380, 200, 120, 120); QuickPDF.DASaveAsFile( FileHandle , 'D:\PDF_With_image.pdf' ); finally QuickPDF.Free; end; //--------------------- how to do please? thanks
Edited by Amelie - 02 Jun 23 at 7:37PM |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3527 |
Post Options
Thanks(0)
|
Hi Amelie :)
Don't mix ... NEVER mix DA-functions with non-DA-functions - This won't work. Take the normal open- and the normal save-function and it will work as expected. Cheers, Ingo Edited by Ingo - 02 Jun 23 at 9:23PM |
|
Cheers,
Ingo |
|
Amelie
Beginner Joined: 10 Nov 17 Location: France Status: Offline Points: 13 |
Post Options
Thanks(0)
|
Hi Ingo,
thank you for help. I have a big file of 600mb, when I open it with ''LoadFromFile'', my application consumes a lot of resources, but, if I open this file with 'DAOpenFile', there is no consumption of resources. - if I use 'DAOpenFile' + 'SaveToFile', the application creates an empty page with the image. - if I use 'LoadFromFile' + 'SaveToFile', it's ok, but a lot of memory consumption. How to solve this problem please? THANKS
Edited by Amelie - 03 Jun 23 at 7:39AM |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3527 |
Post Options
Thanks(0)
|
There's nothing to solve ;-)
Don't mix DA- with non-DA-functions. Try the "normal" functions and do a complete refresh after the call. |
|
Cheers,
Ingo |
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
Provided that your program does not crash on 'out of memory', there should be no problem with using the 'non-DA' functions, other that it being slower to process your very large file. If the other parts of your program give it a very big memory requirement, and the process memory exceeds 2GB, then you can try increasing this by adding {$SETPEFLAGS IMAGE_FILE_LARGE_ADDRESS_AWARE} immediately above the 'begin' in your Delphi DPR file. Or of course you could also build it as a 64-bit process, which might also speed it up a little.
|
|
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