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!
DrawText method slows down on large files |
Post Reply |
Author | |
mburian
Beginner Joined: 10 Jul 06 Location: Australia Status: Offline Points: 17 |
Post Options
Thanks(0)
Posted: 18 Mar 07 at 8:16PM |
Hello All,
I am using the DrawText method to create a PDF document from a Text file.
I am finding that at around 3000 pages the process slows down considerably and by target of 15000 pages is never reached.
Could someone guide me in what factors to look for or be aware of when creating large PDF files?
Snippet of code below:
Do While Not EOF(hFile) ' Loop until end of file.
Line Input #hFile, mytextline ' Read line into variable. 'Output text
X = 1 Y = Y + Line_Space 'Draw text line Call QP.DrawText(X, Y, mytextline) Loop |
|
Mick Burian
|
|
ukobsa
Senior Member Joined: 29 May 06 Location: Germany Status: Offline Points: 115 |
Post Options
Thanks(0)
|
Mick,
maybe I have an idea why it is slowing down. Can you make such a large pdf available? (if not too large: please mail it to support(at)quickpdf.org) Ulrich |
|
mburian
Beginner Joined: 10 Jul 06 Location: Australia Status: Offline Points: 17 |
Post Options
Thanks(0)
|
Hi,
The file being converted is a "text" file. Is this the file you would like?
|
|
Mick Burian
|
|
ukobsa
Senior Member Joined: 29 May 06 Location: Germany Status: Offline Points: 115 |
Post Options
Thanks(0)
|
Mick,
I have done a short test doing the following: - create fresh QuickPDF document - add 5000 new pages - on each page draw 30 text strings well, this last really a lot of time. I have tested it with a profiler and this shows me, that there are some procedures that really could need some optimizations (causing the long processing). So for the moment I cannot see anything to improve the performance without coding. It's maybe a silly question but if you simply want to convert some kind of a text file to PDF: can't you do that by printing the file on a PDF Printer like FreePDF? Ulrich |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Uli!
Can you tell me the relevant procedures? Best regards, Ingo |
|
ukobsa
Senior Member Joined: 29 May 06 Location: Germany Status: Offline Points: 115 |
Post Options
Thanks(0)
|
Ingo,
have a look for - TPDFName.Output - TPDFPainter.MakeFloat - TPDFPainter.AddString - TPDFFont.FixText all of them make massive string operation with '+' which is causing a lot of internal string copying in Delphi. If this can be reduced then the procedures should be faster (especially when they are very often called). I'll send you the track from my profiler by email. HTH, Uli |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Uli!
Thanks. I think since friday the community (we) should do the job again ;-) If everyone just does a little bit ... we'll get something big for all ;-) Best regards, Ingo |
|
swb1
Debenu Quick PDF Library Expert Joined: 05 Dec 05 Location: United States Status: Offline Points: 100 |
Post Options
Thanks(0)
|
A quick suggestion though: look to see whether large strings are passed into functions as var parameters or if they can be. This can help avoid making a copy of the string each time the function is called. Regards, |
|
marian_pascalau
Debenu Quick PDF Library Expert Joined: 28 Mar 06 Location: Germany Status: Offline Points: 278 |
Post Options
Thanks(0)
|
Hi there, if you realy bother only about text information why don't you use SetPageContents function (function name may differ). Produce a demo page grab it's contents, create your own content template and reproduce contents for each page. PS: pay carefull attention on fonts and images.
Best regards, Marian
|
|
mburian
Beginner Joined: 10 Jul 06 Location: Australia Status: Offline Points: 17 |
Post Options
Thanks(0)
|
Hi,
Sorry for not replying sooner.
My process is generic in that every text file converted has different page dimensions which affect the scale factor of the text on each line.
This is why I thought that I needed to process each line. I also need page breaks which are inserted in the text file.
I hope this helps and thanks for all of your input.
Mick
|
|
Mick Burian
|
|
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