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 - Performance when adding text elements
  FAQ FAQ  Forum Search   Register Register  Login Login

Performance when adding text elements

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


Joined: 04 Jan 16
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote x3mike Quote  Post ReplyReply Direct Link To This Post Topic: Performance when adding text elements
    Posted: 04 Jan 16 at 4:54PM
Hello,

I have to "watermark" existing PDF documents with some text elements. The process take a really long time.

For some tests I used this document I googled in the internet: http://scholar.princeton.edu/angelab/publications/super-large-pdf-100mb

What I do:
  • create TMemoryStream and load the data into it
  • create a TQuickPDF instance and load the document from the memorystream
  • Iterate each page, select it and add two text elements
  • save the document back to the stream and save the stream to a file

On my machine this process takes 80 seconds!

How can I speed up the process? This kind of PDF-processing is used on a WebServer which dynamically adds user data to the delivered PDF. A processing time of average 40seconds totally blocks the server ...

Thank you for your help!

Best regards,
Michael

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: 07 Jan 16 at 8:49PM
Hi Michael,

do you think it's faster to do the first two steps instead of using an easy LoadFromFile (into memory as well)?
The same for the last step: An easy SaveToFile should be faster.
But all this saves time at the beginning and at the end. Most of the time will be consumed while working on the pages.
Here's a sample from the Debenu-knowledgebase about watermarking. If you do it the same way i fear there's no further time save option:
http://www.debenu.com/kb/programmatically-add-watermark-stamp-pdf/

BTW: A 100-mb-file on disk could be a much bigger file if it's loaded and structured into the memory.

Cheers and welcome here,
Ingo



Edited by Ingo - 07 Jan 16 at 8:52PM
Cheers,
Ingo

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