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 - Slow RenderPageToFile for TIFF
  FAQ FAQ  Forum Search   Register Register  Login Login

Slow RenderPageToFile for TIFF

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


Joined: 20 Dec 20
Location: Munich
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michi91 Quote  Post ReplyReply Direct Link To This Post Topic: Slow RenderPageToFile for TIFF
    Posted: 20 Dec 20 at 2:59PM
Hello QuickPDF community.

I use QuickPDF 1811 x64 to extract TIFF pages from PDF, then process them with tesseract
and merge the PDF FullText Only Document again with the orignal PDF.

That works well, my Problem is just that the RenderPageToFile and RenderDocToFile seems quite slow for big Documents and TIFF

Here is my Sample Document:
https://www.file-upload.net/download-14402446/LoreIpsum106Pages.pdf.html

With both TiffLzw and TiffG4 and with RenderPageToFile to individual pages and RenderDocToFile to a single file they both take arround 44 Seconds when converted with 300 dpi.

I would prefer to render every page to an indivdual file (RenderPageToFile).
If I use Ghostscript 9.53.3 with -r300x300 -sDEVICE=tiffg4 (so the same) it takes 5,8 seconds.

Can I accerate that?
For example is RenderPageToFile Multi Threading Capable? Could I load the document and call RenderPageToFile in different worker threads?

I am using C# + net5.0 and the x64 DLL Version DebenuPDFLibrary64DLL1811.dll

Thank you for your help and Merry Christmas




Edited by Michi91 - 20 Dec 20 at 3:05PM
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: 20 Dec 20 at 11:11PM
Hi Michi :)

is it necessary to render a page which has originally 72 dpi with 300 dpi?
Quality won't be better i think ;-)
Making 106 image files out of 1 document needs time.
If the results will be still okay for you i would try to render with 150 or less dpi...

Another option is to select another render engine like cairo for example, AGG or PDFium for better results -> https://www.debenu.com/docs/pdf_library_reference/SelectRenderer.php

Here you'll find the developer guide and much more:
http://www.quickpdf.org/


Cheers and welcome here,
Ingo

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: 21 Dec 20 at 8:48AM
I tried rendering your file with our application which converts to monochrome 200dpi multi-page TIF, and it took about 30 seconds. It was not much different with PDFIUM. Of course a proportion of this time was spent dithering to bi-level; a color TIF should be faster, although there is more data to write. And there are doubtless many other variables which differ between your environment and mine.

The only reliable way to determine whether it is better to render pages in different threads is to try it.
Back to Top
Michi91 View Drop Down
Beginner
Beginner


Joined: 20 Dec 20
Location: Munich
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michi91 Quote  Post ReplyReply Direct Link To This Post Posted: 21 Dec 20 at 6:05PM
Hello Ingo and tfrost,

thank you for your quick answers.

Ingo: I guess it is not required ;) But can I quickly check what is the max dpi used in an document?

Checking all images in the file won't make it quicker?
http://www.quickpdf.org/forum/renderpage-dpi-from-current-pdf_topic2893.html

I was just suprised that Quickpdf takes 44 seconds and ghostscript COMMANDLINE 5,8 seconds for 300 dpi and the same document.

@tfrost: I think I will try multithreading, if that doesn't work I think about a way with Ghostscript.

Merry Christmas, I would come back to you both in January. :)





Edited by Michi91 - 21 Dec 20 at 6:05PM
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: 22 Dec 20 at 11:53AM
Hi Michi,

render page to file doesn't mean image extraction - due to this a din a4-page you can render with 72 dpi. You can use more dpi but this won't raise the quality of the image.
Rendering only paint the pdf-page onto an image file - that's all.
QuickPDF offers real functions to extract embedded image files out of a pdf but that's another thing.
Real multi threading won't work so i think you should start trying Ghostscript.

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