Click here to Skip to main content
Click here to Skip to main content

Convert Tiff To Pdf

, 17 Feb 2003 BSD
Rate this:
Please Sign up or sign in to vote.
Tiff To PDF conversion Source Code.

Introduction

After looking everywhere for TiffToPdf source code, I decided to write my own conversion routine. It is fairly simple and straight forward and it fits my needs. I decided to return the favor and post this code here so others that need the capability can utilize it as well. Currently it only supports Tiff Image files in Fax formats.

What you need to compile.

You will need CXImage to compile and build. It only uses the CXFile / LIBTIFF functions of CXImage but CXImage is a nice library anyways.

Where to go from here

If you would like to extend it and make improvements on it please send me an e-mail with your improvements, and suggestions. It would be nice to extend this functionality.

How to use

This is the class function declaration for CDTPDFConvert::TiffToPdf The function requires an input tiff file. If there is no output pdf file it will use the tiff file name with the .pdf extension, the additional paramaters are for the pdf info header.

int TiffToPdf( char* a_tiff, char* a_pdf, char* a_szCreator,
                         char* a_szCreationDate, char * a_szAuthor,
                                   char * a_szProducer, char * a_szTitle,
                                   char * a_szSubject, char * a_szKeywords  );

This is an example of how to use the class. The class is wrapped with exception handling and has a error string that returns limited info if there was a problem. The error checking and exception handling can be improved drastically but for this purpose if you choose to use the code that is your responsibility.

void main()
{ 
  CDTPDFConvert convert;
  if (convert.TiffToPdf( a_in_tiff, a_out_pdf, Additional Paramaters ) < 1) {
    printf( convert.m_szErrorCode );
  } else
    printf( "Converted Tiff to Pdf!" );
}

Edit Revision

21 Nov 2002 - Initial Editing

18 Feb 2003 - I removed CXImage Dependicies (Code is loosely based on CXImage Lib a really cool library get it!). I also added libtiff into zip file. Added several image compression routines, and made it easier to build.

14 July 2003 - If you need the most recent working version of this source code with improvements and bug fixes check out my website. www.rubisoftware.com

License

This article, along with any associated source code and files, is licensed under The BSD License

Share

About the Author

sirrube
Web Developer
United States United States
A Software Developer.

Comments and Discussions

 
GeneralRe: bmp jpg gif png PinmemberVasudevan Deepak Kumar14-Mar-06 5:18 
Generaltoo big Pinmembercsunny10-May-05 18:52 
QuestionHow about PDF to TIFF PinsussAnonymous12-Dec-04 16:22 
AnswerRe: How about PDF to TIFF Pinmemberdeepak82788-Feb-05 22:15 
GeneralRe: How about PDF to TIFF Pinmemberjmlynn10-Feb-05 16:49 
GeneralRe: How about PDF to TIFF Pinmemberdeepak827810-Feb-05 21:12 
GeneralRe: How about PDF to TIFF PinmemberPaul R.7-Nov-07 9:14 
AnswerRe: How about PDF to TIFF Pinmemberfastal28-Feb-08 8:55 
GeneralCompilation problem Pinmemberksvenkatakrishnan1-Oct-04 3:15 
GeneralRe: Compilation problem PinmemberPandele Florin18-Apr-05 0:32 
GeneralERROR Pinsusspubba19-Jul-04 19:36 
QuestionHow to add bmp file as PDF File Format. Pinsusspubba18-Jul-04 20:19 
QuestionHow to convert from txt to tiff??? PinmemberJigar Mehta4-Jun-04 21:19 
AnswerRe: How to convert from txt to tiff??? Pinmemberal_yakout4-Jun-04 23:02 
GeneralRe: How to convert from txt to tiff??? PinmemberJigar Mehta4-Jun-04 23:45 
GeneralRe: How to convert from txt to tiff??? PinsussAnonymous5-Jun-04 20:55 
GeneralRe: How to convert from txt to tiff??? Pinmemberal_yakout5-Jun-04 20:56 
GeneralRe: How to convert from txt to tiff??? PinmemberJigar Mehta6-Jun-04 18:46 
GeneralRe: How to convert from txt to tiff??? Pinmemberal_yakout7-Jun-04 20:14 
AnswerRe: How to convert from txt to tiff??? PinmemberJigar Mehta12-Aug-04 2:41 
GeneralRe: How to convert from txt to tiff??? Pinmembersirrube12-Aug-04 6:45 
GeneralMany TIFFs to one PDF Pinmember80x8628-May-04 3:58 
GeneralRe: Many TIFFs to one PDF PinmemberReanimatorLtd3-Aug-04 3:35 
GeneralRe: Many TIFFs to one PDF Pinmembersirrube3-Aug-04 8:04 
GeneralRe: Many TIFFs to one PDF PinmemberDmitry Feoktistov18-Apr-11 23:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.1411019.1 | Last Updated 18 Feb 2003
Article Copyright 2002 by sirrube
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid