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!
![]() |
Hangs up using TIF! |
Post Reply ![]() |
Author | |
kukulkan ![]() Team Player ![]() ![]() Joined: 02 Mar 06 Location: Germany Status: Offline Points: 20 |
![]() ![]() ![]() ![]() ![]() Posted: 25 Apr 06 at 8:09AM |
Hi,
I try to convert a multipage TIFF into a PDF using QuickPDF (V5.14 ActiveX-Version). Here is the code (parts): Private Sub DoBitmap() Dim PDF As New iSED.QuickPDF Dim x As Long Dim Dat As String Dim cErr As Long Dim Erg As Long Dim parFilename As String Dim E As Long parFilename = "c:\TestDokument.tif" PDF.UnlockKey "xxxxxxxxxxxxxx" PDF.SetOrigin 1 ' //To top left PDF.SetMeasurementUnits 1 ' //means millimetres PDF.SetPageSize "A4" ' ' insert all tiff-pages to pdf-pages x = 0: Erg = 1 While Erg <> 0 x = x + 1 If x > 1 Then PDF.NewPage Erg = PDF.AddTIFFImageFromFile(parFilename, x) If Erg <> 0 Then E = PDF.DrawImage(0, 0, PDF.PageWidth, PDF.PageHeight) End If Wend PDF.CompressContent PDF.SaveToFile "c:\Test.pdf" End Sub Using this picture (only for example. I have lots of other pictures that don't work) hangs up using 100%. It hangs on the first call of PDF.AddTIFFImageFromFile() with correct parameters (good filename and x=1). Here is the picture: picture with about 600KB and two pages. [EDIT] removed link on 27 Apr 2006[/EDIT] Please, can someone help me? Using JPG works fine (one page documents)! Kukulkan Edited by kukulkan |
|
![]() |
|
chicks ![]() Debenu Quick PDF Library Expert ![]() Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
![]() ![]() ![]() ![]() ![]() |
Haven't tried your tiff, but a possible workaround is to convert your tiff files to PDF first, then import them with QuickPDF. Here's a freeware tiff2pdf converter:
http://www.dreamsyssoft.com/tiff-to-pdf/ |
|
![]() |
|
kukulkan ![]() Team Player ![]() ![]() Joined: 02 Mar 06 Location: Germany Status: Offline Points: 20 |
![]() ![]() ![]() ![]() ![]() |
Hi chicks,
Thank you, but I chose QuickPDF because I don't need any other dll's or programs to do my job. Now, the TIF's can't get imported. tiff2pdf is only free for freeware-products. I need it for a commercial project. Can someone look at my code above and use my tiff to reproduce the error? Maybe someone of the code-specialists can fix the problem? Is it possible to add a bitmap to a PDF using it's hDC or Handle? This would help in my case... Kukulkan Edited by kukulkan |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi!
I've tried it with AddTIFFImageFromFile... and it doesn't work, too. I don't have hangups but it lasts a long time (few minutes) and the resulting pdf-file has only 2kb with one blank page. With Foxit i can see it immediately - adobes reader can't make this pdf ready and hang up. The image looks a bit strange... ;-) Perhaps you should ask how the relevant images were created? Good luck! Best regards, Ingo Edited by Ingo |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Kukulkan!
I've found the problem! The tif is lzw-compressed. I've opened it with IrfanView and have saved each of the two pages as tif without lzw-compression. This new tifs i could generate to pdf quickly. Then merging and i have the new pdf. BTW: The tifs without lzw-compression are smaller then the one with compression ;-) Best regards, Ingo Achja... Vielleicht solltest Du Dokumente dieser Art nicht einfach so ins Netz stellen...? |
|
![]() |
|
kukulkan ![]() Team Player ![]() ![]() Joined: 02 Mar 06 Location: Germany Status: Offline Points: 20 |
![]() ![]() ![]() ![]() ![]() |
Hi Ingo,
Thank you for your test. So it is not only my system with this problems. The image is not good, I know (it is a converted one). But the content doesn't mather here. Programs like ACDSee, Windows Imaging, Leadtools, QuickView and others can open this picture without problems. So it is definitive a bug in QuickPDF. Is it possible to add image if I have an ImageDC or BitmapDC? This will be the only way I can handle this problem (if no one of the programmers will fix the bug). [EDIT]Hi Ingo, thank you, but the pictures are scanned by a customer of mine and I dont have the possibility to change the format (it is an archive of 10 years). PS. Das ist ein Spass-Text der als Gag durchs Internet ging... Kukulkan Edited by kukulkan |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi again ;-)
...but you can use a small tif2jpg-component... converting the jpgs to single pdf-pages... and then merge... Not a short way... but as a workaround... ;-) Best regards, Ingo |
|
![]() |
|
chicks ![]() Debenu Quick PDF Library Expert ![]() Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
![]() ![]() ![]() ![]() ![]() |
kukulkan,
OK, downloaded your Tiff, and was able to convert it to jpg and bmp using the GDI+ API (available on Win2K and above by default, can be installed on '95 & '98) using this example: http://www.powerbasic.com/support/forums/Forum7/HTML/002273.html The example only does the first page, you'll need to dig into the API to do multiple pages. Here's a compiled version of the converter for testing: http://www.geocities.com/sea_sbs/files/gditools.zip Note that it has a funky argument format, expecting commas between input and output paths. Note further that AddTIFFImageFromFile() has been deprecated, should be using AddImageFromFile() instead. Another free Tiff library is here: http://www.libtiff.org/ It includes a bunch of tools, including one that converts multi-page Tiffs to PDFs. I have compiled it under MSYS/MinGW to Windows .exe format, but the tools are also available in compiled form. There is probably a DLL version available out there, as well. Edited by chicks |
|
![]() |
|
kukulkan ![]() Team Player ![]() ![]() Joined: 02 Mar 06 Location: Germany Status: Offline Points: 20 |
![]() ![]() ![]() ![]() ![]() |
Hi chicks,
Thank you for your effort. I searched, which library's my customer has around on his systems and found freeimage-library (for another application) which is able to load theese images, too. So I load the images using freeimage and save them as JPG to add to the PDF-file (all in one loop). GDI+ would be nice, too. But the customer uses a lot of NT4 systems and I don't know if GDI+ is available on all his systems. Thank you again, but is it a general problem using LZW coded TIF-files together with QuickPDF? Kukulkan |
|
![]() |
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