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!
DrawImage Settings and Memory Issue |
Post Reply |
Author | |
eddy2099
Beginner Joined: 08 Feb 10 Status: Offline Points: 10 |
Post Options
Thanks(0)
Posted: 08 Feb 10 at 8:23AM |
I am currently evaluating v7.17 and my main use of the library would be to merge images into a single pdf file.
1) DrawImage
I was reading up on the DrawImage method which reads function TQuickPDF0717.DrawImage(Left, Top, Width,
Height: Double): Integer; and try the following line
QP.DrawImage(0,0,lWidth,IHeight);
It however does not draw anything but blank pages.
I found the Delphi_DCU_Convert_Image_to_PDF example and found the implementation as and that did the trick as the image filled the whole page.
I am actually confused here, shouldn't the 'Top' parameter refers to the top most pixel in which to place the image and not the bottom most pixel to place the image.
Is there an error to the component implementation or the documentation in wrong in this or I am just misinterpreting this.
2) Memory Issue
The second issue I have is that I would need to add some 200 odd images to a single PDF file and for my test of about 180 jpeg images, the memory usage keeps ballooning each time I add an image. Is there a way to get the library to write to file midway, I did use the 'SetTempFile' and 'SetTempPath' but it looks like they were not being used. With 180 images, it seems to work fine as the memory usage for the program was about 600mb. However when I added some 500 images, when it hits about 1.8gb memory usage, it stopped accepting images and reject them. Also the PDF file generated was about 6kb which was apparently in error. Is there anything I can do to prevent this from happening ? Sorry but I am new to this library. However, I must say that it is quite fast in adding the images. Overall the output looks good when it worked. Edited by eddy2099 - 08 Feb 10 at 8:48AM |
|
Shotgun Tom
Senior Member Joined: 14 Aug 09 Location: Phoenix, AZ Status: Offline Points: 53 |
Post Options
Thanks(0)
|
Hi:
By default, a PDF's document origin is at the bottom left of the page. You can change this using the QuickPDF Library. See the "Set Origin" method. If, for example, you want to set the origin to top left then the method would be QP.SetOrigin(1). Now when you use Drawing commands it starts at the top left instead of the bottom left of the document.
Tom
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Eddy!
The newest version shouldn't have problems with memory. But if it's like you told us: Try to make a "free" after a fix number of images and then a new "create" with the next images and so on... all appending to the first pdf-part. Long time ago i've done it this way to avoid memory-problems. Cheers, Ingo |
|
eddy2099
Beginner Joined: 08 Feb 10 Status: Offline Points: 10 |
Post Options
Thanks(0)
|
Hi Tom and Ingo,
Thank you very much for answering my questions. I've looked at the DAAppendFile but apparently that was the wrong direction to take since it did not really work in my case. I supposed that I could create several PDF files, perhaps 100 images per file then use MergeFileList to combine them all. If there is any suggestions, do feel free to drop them here ;) Thanks again, you are certainly a very helpful bunch. Edited by eddy2099 - 09 Feb 10 at 1:14AM |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Eddy!
Here you can see what i mean with "a free from time to time": http://www.quickpdf.org/forum/creating-large-files-very-slow_topic813_post3919.html?KW=QP.Free#3919 What's your problem with DAAppendFile? Please keep in mind that it's not possible to mix the DA-functions with the non-DA-functions! Try the search-functionality (advanced) above with "QP.Merge"... you'll find many samples. Cheers and welcome here, Ingo |
|
eddy2099
Beginner Joined: 08 Feb 10 Status: Offline Points: 10 |
Post Options
Thanks(0)
|
Thanks Ingo.
Sorry I am new at this. When I tried to do the DAFileAppend method, it does seems that it does not work with the DrawImage method. I read that there is a limit to what Direct Access methods and functions can do. As such, probably my option would be to probably create say PDF of about 100 pictures each then merge them once all the 'smaller' pdfs are created. |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
"...
When I tried to do the DAFileAppend method, it does seems that it does not work with the DrawImage method. ..." Like i've written: Don't mix DA with non-DA ... Cheers, Ingo |
|
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