PDF generation from tiff, jpeg...

Discussions on GFL SDK, the graphic library for reading and writing graphic files

Moderators: helmut, XnTriq, xnview

Post Reply
User avatar
dominique
Posts: 72
Joined: Thu Nov 08, 2007 9:22 am

PDF generation from tiff, jpeg...

Post by dominique »

Hi GFLSDK Team and friends,
I 'm testing translation from Jpeg or Tiff images to PDF format.
My objective is to save PDF with JPEG 80 encapsulated images for example.
If input image format is JPEG or TIFF, SDK saves PDF using TIFF LZW compression with no respect of save options.
If I do the same (with identical save options) from PDF input, SDK works fine respecting save options!
Even if save option structure seems to be ok (I use : FormatIndex, Compression and Quality), I think I miss something in options but don't see witch parameters.
Someone to help?
Rgds
Dom
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: PDF generation from tiff, jpeg...

Post by xnview »

dominique wrote:Hi GFLSDK Team and friends,
I 'm testing translation from Jpeg or Tiff images to PDF format.
My objective is to save PDF with JPEG 80 encapsulated images for example.
If input image format is JPEG or TIFF, SDK saves PDF using TIFF LZW compression with no respect of save options.
If I do the same (with identical save options) from PDF input, SDK works fine respecting save options!
Even if save option structure seems to be ok (I use : FormatIndex, Compression and Quality), I think I miss something in options but don't see witch parameters.
Someone to help?
Rgds
Do you change the Compression?
Pierre.
User avatar
dominique
Posts: 72
Joined: Thu Nov 08, 2007 9:22 am

Post by dominique »

Yes I try to Change the Compression method.
With a JPEG or TIFF input :
If I choose No Compression, I have a PDF File which is a little bit bigger than my tiff=> ok that's fine
Same thing with LZW Compression (with a smaller output file).
If I put JPEG Compression with Quality X, the file generated is like a TIFF LZW.
I've compared save options between JPEG source and PDF source with the deboger and every options seems to be the same.
I continue reading Documentation and Forum :)
Thx for your help !
Dom
User avatar
dominique
Posts: 72
Joined: Thu Nov 08, 2007 9:22 am

Post by dominique »

Here is an exemple of who I do :

Code: Select all

GFL_BITMAP              *mBitmap;
GFL_FILE_INFORMATION    mImageInfo;      // Données image
GFL_FORMAT_INFORMATION  mFormatInfo;     // Données sur le format de l'image
GFL_ERROR               mErr;            // Code d'erreur
GFL_LOAD_PARAMS         mLoadOption;     // Options d'ouverture de l'image
GFL_SAVE_PARAMS         mSaveOption;     // Options  d'écriture de l'image
gflLibraryInit();
gflGetDefaultLoadParams( &mLoadOption );
mErr = gflLoadBitmap( "toto.tif", &mBitmap, &mLoadOption, &mImageInfo );
if (!mErr)
{
                gflGetDefaultSaveParams(&mSaveOption);
                mSaveOption.FormatIndex = 54;
                mSaveOption.Compression = GFL_JPEG;
                mSaveOption.Quality     = 80;
                mErr = gflSaveBitmap( "toto.pdf", mBitmap, &mSaveOption);
                int toto = 13;          // break point
}
gflLibraryExit();
May it can show you my mistake!
Dom
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview »

Ok, right. Please send me your email by PM, i would like to send you a fixed version...
Pierre.
User avatar
dominique
Posts: 72
Joined: Thu Nov 08, 2007 9:22 am

Post by dominique »

Problem solved with your modifications (library correction sent by e-mail)
Thank you!

PS : Thx to the GFL team for this lib!
Dom
Post Reply