LEADTOOLS Support
Document
Document SDK Questions
Converting JPEG to Multi-Page PDF is Too Slow
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, March 27, 2008 9:45:45 AM(UTC)
Groups: Registered
Posts: 1
I'm using the following code in Leadtools 14.0 with VB6 to convert several JPEGS into multi-page PDFs:
For n = 1 To ColImages.count
intReturn = LEAD1.Load(ColImages(n), 0, 0, 1)
intReturn = LEAD1.Save(strDestFile, FILE_RAS_PDF_JPEG, 24, 2, SAVE_APPEND)
Next
Call FreeBitmap(frmMain.LEAD1)
Many of these will be comprised of 500+ jpegs and it takes about 5 minutes for each of those. I do not need the image display and need to find a better way of doing this rather than to append to my file 500+ times. I'm wondering if the LoadMemory/LoadArray will solve my problem and am hoping for an example if this is the way to go. Thanks for your help.
#2
Posted
:
Friday, March 28, 2008 3:45:53 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 764
Unfortunately, this code is so simple, there's not much more you can do to speed it up.
Since the files are coming in from disk, you don't want to change how you're loading it because you'll only add more processor ticks by loading them into memory, then loading them into the Lead Main control from memory.
In the saving you might be able to save a little bit of time by saving to memory (SaveMemory/SaveArray) the same way you are now and then saving that buffer out to disk. This could go either way though. If your final PDF file is larger than the amount of memory you have available, then it will actually be slower than doing what you are right now becuase using virtual memory will be slower than simply writing the files to disk.
LEADTOOLS Support
Document
Document SDK Questions
Converting JPEG to Multi-Page PDF is Too Slow
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.