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 > I need help - I can help
  New Posts New Posts RSS Feed - Hanlde Multiple PDF Pages to Multiple Pages TIFF
  FAQ FAQ  Forum Search   Register Register  Login Login

Hanlde Multiple PDF Pages to Multiple Pages TIFF

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


Joined: 22 Jan 20
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote rocky1 Quote  Post ReplyReply Direct Link To This Post Topic: Hanlde Multiple PDF Pages to Multiple Pages TIFF
    Posted: 23 Jan 20 at 10:58AM
Hi I am Currently using 
DebenuPDFLibraryDLL1011 at my end.

I am trying to read the multiple pages pdf file into a multiple tiff or into a byte stream 
can it possibly done by using RenderPageToString ?
Here is my sample code
List<Bitmap> listOfImages = new List<Bitmap>();

                PDFLibrary PL = new PDFLibrary(strDLLPath);

                if (PL.LibraryLoaded())
                {
                    PL.UnlockKey(PdfTask.DebenuPDFLibraryUnlockKey);
                    PL.LoadFromFile(strFileName, string.Empty);
                    const float renderDPI = 180;
                    int intPageCount = PL.PageCount();

                    for (int intPageIndex = 1; intPageIndex <= intPageCount; intPageIndex++)
                    {
                        // PDF to bitmap
                        byte[] bytesPageBitmap = PL.RenderPageToString(renderDPI, intPageIndex, 7);
                        MemoryStream msPageBitmap = new MemoryStream(bytesPageBitmap);
                        Bitmap pageBitmap = (Bitmap)Image.FromStream(msPageBitmap);
                        pageBitmap.SetResolution(renderDPI, renderDPI);

                        listOfImages.Add(pageBitmap);
                    }

                }

Back to Top
rocky1 View Drop Down
Beginner
Beginner


Joined: 22 Jan 20
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote rocky1 Quote  Post ReplyReply Direct Link To This Post Posted: 23 Jan 20 at 4:11PM
Can anyone help me out here?
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 271
Post Options Post Options   Thanks (1) Thanks(1)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 23 Jan 20 at 7:55PM
I am afraid am not familiar with the DLL interface, or with using QuickPDF in ths way.  But in general, precisely what problems to you see when you run this code in your debugger? What data actually turns up in the string and does it look like a bitmap?  Have you tried RenderAsMultipageTIFFToFile ?
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3079
Post Options Post Options   Thanks (1) Thanks(1)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 23 Jan 20 at 9:58PM
Hi Rocky,

Here it's the other way round to give you an idea what could be possible:
https://www.debenu.com/kb/create-a-multi-page-pdf-from-a-multi-page-tiff-programmatically/

This is the function Tim (TFrost) is talking about. It should feed your needs:
https://www.debenu.com/docs/pdf_library_reference/RenderAsMultipageTIFFToFile.php
There's a stream version, too.

I don't have samples regarding this functionality but the developer guide and the online reference will help as well.

BTW: There's no need to ask again after some hours. Here's not too much traffic and not all members are familiar with all issues. So sometimes you have to do the first steps with your problem alone and if you have solve your problem you can post the solution here (in the samples section) to help the other ones ;-)



Edited by Ingo - 23 Jan 20 at 10:01PM
Cheers,
Ingo

Back to Top
rocky1 View Drop Down
Beginner
Beginner


Joined: 22 Jan 20
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote rocky1 Quote  Post ReplyReply Direct Link To This Post Posted: 24 Jan 20 at 7:33AM
Hi tfrost,
Thanks for the response 
as I did tried using RenderAsMultipageTIFFToFile and I was able to successfully convert the Multiple Page PDF doc to Multiple Tiff File

But there's only one problem to it - when it is converting to the GrayScale it is skipping the PDF header image.

Here's my sample Code which is working -
              //DLL file path
                string strDLLPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
                    PdfTask.DebenuPDFLibraryDLL);

                PDFLibrary PL = new PDFLibrary(strDLLPath);

                if (PL.LibraryLoaded())
                {
                    PL.UnlockKey(PdfTask.DebenuPDFLibraryUnlockKey);

                    var strFileName = @"H:\SampleFile\samplecolor.pdf";
                    PL.LoadFromFile(strFileName, string.Empty);
                    const float renderDPI = 180;

                    int intPageCount = PL.PageCount();
                    int xx = PL.RenderAsMultipageTIFFToFile(renderDPI, "1-5", 1, 0, @"D:\aaaaa.tif");
                    if (xx == 1)
                    {
                    }


Here's the PDF Image -

Here's is the TIFF Image when converted to grayscale -
https://imgbbb.com/image/L3pw8v 


All the pages are writing under Tiff correctly only thing it is skipping the header part not sure what I am doing wrong this problem only comes when writing into the grayscale mode 

Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 271
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 24 Jan 20 at 12:23PM
Sorry, that website does not let me dowload your PDF, even after creating an account, so there is not much more I can say about what the problem might be.  If I had the PDF, I could at least tell you whether it converts correctly for me in QuickPDF, with our PDF to TIFF tools.
Back to Top
rocky1 View Drop Down
Beginner
Beginner


Joined: 22 Jan 20
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote rocky1 Quote  Post ReplyReply Direct Link To This Post Posted: 24 Jan 20 at 1:33PM
Hi tfrost 
Here's the PDF which I am using currently

Link to Download




Edited by rocky1 - 24 Jan 20 at 1:35PM
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3079
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 24 Jan 20 at 2:26PM
perhaps the problem is that the header of the pdf-page was an embedded image?
What about rendering the page to any other coloured image type... how it looks like?
BTW: Till now each new version comes along with enhancements and fixes regarding rendering. Then i see that you're still using version 10.11 - so a test from Tim with an actual version of the library could be very useful for you...

Cheers,
Ingo

Back to Top
rocky1 View Drop Down
Beginner
Beginner


Joined: 22 Jan 20
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote rocky1 Quote  Post ReplyReply Direct Link To This Post Posted: 24 Jan 20 at 2:34PM
Hi Ingo, 
Yes the other Colored image type is working fine. It has no issues.
I am not sure whether its an embedded image or not. 
I am just using a sample pdf for my test cases.
Thanks
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 271
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 25 Jan 20 at 12:04AM
The whole document renders to gray for me with v17.11, and nothing seems to be missing.  If you are using the function I suggested both for colour (option 0) and grayscale (1) and only the former produces the correct output, then it is probably an issue in the old version of QPDF you are using.  I always convert to colour BMP first, then use our own dithering options to get the maximum quality B/W image for faxing. We need complete control over the resolution, size and quality.  If you need true grayscale output rather than monochrome, I would convert the color to grayscale after creating the image from QPDF. In my TIF the 200dpi output is a bit fuzzy because hardly any of the original text is black.

I will try to find a convenient way to get the TIF I have created to you.  But all the work we do is the colour to monochrome; rendering the colour output from QuickPDF is the simple part!
Back to Top
rocky1 View Drop Down
Beginner
Beginner


Joined: 22 Jan 20
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote rocky1 Quote  Post ReplyReply Direct Link To This Post Posted: 27 Jan 20 at 6:29AM
Thanks for the Update tfrost,
so as i am using  QPDF -  DebenuPDFLibraryDLL1011 v 10.11  can you please let me know the process require to update as I am already having a license key for v10.11
1.Do I need to buy the new version of QPDF?
2.Will my existing license key supports the updated version of  QPDF?
3. Will an update cost to me? or if there's any link where I can look into it it will be really helpful.

Thanks

Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 271
Post Options Post Options   Thanks (1) Thanks(1)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 27 Jan 20 at 8:44AM
You will need to contact Foxit if you want to upgrade.  This is a user forum.  You can also perhaps get a trial of the later release to test if the rendering is improved.

And please note that I am using Delphi, not the DLL version.  So the functions I am using which render directly to bitmaps are much more convenient than those in the DLL, and my processing of the colour bitmaps afterwards to create multi-page monochrome TIF is our own code, not in QuickPDF.  But the PDF rendering should be common to both editions
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3079
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 27 Jan 20 at 11:31AM
ask for a testversion to evaluate:
https://www.debenu.com/products/development/debenu-pdf-library/trial/

where to buy the latest version of the library:
https://www.debenu.com/store/buy-quick-pdf-library/

for upgrade prices of the library:
https://www.debenu.com/store/buy-quick-pdf-library-upgrade/


Cheers,
Ingo

Back to Top
rocky1 View Drop Down
Beginner
Beginner


Joined: 22 Jan 20
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote rocky1 Quote  Post ReplyReply Direct Link To This Post Posted: 27 Jan 20 at 1:54PM
Thank you for the update.
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