Print Page | Close Window

Problem with TIF to PDF

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=767
Printed Date: 10 May 24 at 5:08AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Problem with TIF to PDF
Posted By: JimCanuck
Subject: Problem with TIF to PDF
Date Posted: 13 Aug 07 at 11:38AM

Greetings to all. I am new to the forum.

I have been using ISED.dll (ver 4) with VB6 for a while to do basic pdf document manipulation, then recently, I needed to convert TIF image files to PDF documents.  I tried the obvious AddImageFromFile() function, but have problems.
 
As I found after (finding! ) and searching on this forum, there has been problems with blank pages in the PDF after loading image files, which appears to have been addressed in ver 5.21 and later, but after trying this new version, I still get blank pages. 
 
Can some one provide a little example code of the correct way to import TIF images to produce good PDF documents? I will be converting multiple tifs, one tif per page, each sized to fit the current page size, into new PDF documents. The documents will not contain any other objects.
 
I am importing Tif files with LZW or Packbit compression, 8 bit color, 50 to 600 dpi. Also some G4 or G3 fax format files.
 
Here is my code that I have been trying. I am trying to load a single tif (less than one A4 page in size) to a one page PDF for starters.
 
  Dim QP As iSED.QuickPDF
  Set QP = CreateObject("iSED.QuickPDF")
  QP.NewDocument
  QP.NewPage
 
'add the image tif file
  rsp = QP.AddImageFromFile(inputTifFileName, 0)
'make the document
  rsp = QP.SaveToFile(pdfoutputFile)
  Set QP = Nothing
 
 
Thanks in advance for any help you can 'render'  Tongue
 
Jim



Replies:
Posted By: marian_pascalau
Date Posted: 13 Aug 07 at 11:54AM
Hi there,
remove the call to NewPage and everything should be ok. Please do not forget that in QuickPDF an empty document has always an empty page.


Posted By: JimCanuck
Date Posted: 13 Aug 07 at 12:11PM
Marian:
 
Thank you for the very fast reply!
 
Sorry, your suggestion did not solve the problem. It did of course remove the second page from the resulting document.  
 
So other than incompatible image files or silly programming mistakes, there should be no problem creating PDF from TIF now with 5.21 or later?
 
 I have tried a few tif variants (LZW, RLE, no compression) and BMP converted images, with the same blank page results.
 
I am definitely using ised.dll  ver 5.22.0.145  in (VB 6 on WinXP)
 
Any further suggestions will be welcomed.
 
Jim


Posted By: marian_pascalau
Date Posted: 15 Aug 07 at 8:23PM
Jim,
I have answered you directly per email. To make sure that this solution is visible for the whole community I will place my solution here as well:
 
  Dim QP As iSED.QuickPDF
  Set QP = CreateObject("iSED.QuickPDF")
  QP.NewDocument
  ' QP.NewPage
  ' - NewPage is not needed because a NewDoc has always a new Page
 
'add the image tif file
  rsp = QP.AddImageFromFile(inputTifFileName, 0)
  call QP.DrawImage(left, top, width, height)
  ' this call you have to add to your source code
'make the document
  rsp = QP.SaveToFile(pdfoutputFile)
  Set QP = Nothing 
 
Best regards, Marian


Posted By: JimCanuck
Date Posted: 16 Aug 07 at 2:07PM

This does indeed solve the problem. Thank for all the great support.

Time to study more interesting details about creating PDF!
 
Cheers! Jim



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk