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 > General Discussion
  New Posts New Posts RSS Feed - Add image to PDF File with "DAOpenFile"
  FAQ FAQ  Forum Search   Register Register  Login Login

Add image to PDF File with "DAOpenFile"

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


Joined: 10 Nov 17
Location: France
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Amelie Quote  Post ReplyReply Direct Link To This Post Topic: Add image to PDF File with "DAOpenFile"
    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
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: 02 Jun 23 at 9:23PM
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

Back to Top
Amelie View Drop Down
Beginner
Beginner


Joined: 10 Nov 17
Location: France
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Amelie Quote  Post ReplyReply Direct Link To This Post Posted: 03 Jun 23 at 7:39AM
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
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: 08 Jun 23 at 9:36PM
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

Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 09 Jun 23 at 2:28PM
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.
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