Page 1 of 1

TIFF to PDF conversion

Posted: 2007-01-30T06:53:25-07:00
by rperez
Hi All,
I have a C++ application running on Linux.
I need to convert TIFF data to PDF. I also need it to be in-memory process without reading/writing to/from files.
is there any way I could do it with ImageMagick?

Thanks,
Ronen.

Posted: 2007-01-30T07:50:44-07:00
by magick
The ImageMagick Magick++ interface has blob methods for importing and exporting images in memory.

Re: TIFF to PDF conversion

Posted: 2007-02-13T05:10:57-07:00
by rperez
Hi there,
I tried to run this sample code:

const string& fFileName = "c:\\1RegPage.tiff";
Image image(fFileName);

Blob blob;
image.magick( "PDF" );
image.write( &blob );
Image image2(blob);
try
{
image2.write("c:\\1RegPage.pdf");
}
catch (Magick::Exception& e)
{
cout << "EXCEPTION!!! - " << e.what() << endl;
}
and the output was:

EXCEPTION!!! - ImageMagick: NegativeOrZeroImageSize `c:\1RegPage.pdf' `c:\1RegPage.pdf'

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

what am I doing wrong? is TIFF to PDF supported that way?

Thanks,
Ronen.

Re: TIFF to PDF conversion

Posted: 2007-02-13T06:37:28-07:00
by rperez
Hi,
I forgot to mention that I am working with ImagaMagick 6.2.8-8.

Ronen.

Re: TIFF to PDF conversion

Posted: 2007-02-13T08:55:43-07:00
by magick
We tried your code with ImageMagick 6.3.2-4, the latest release and it worked without complaint.

Re: TIFF to PDF conversion

Posted: 2007-02-15T06:12:22-07:00
by rperez
Hi There,
I upgraded my version to:
ImageMagick 6.3.2 02/15/07 Q8 http://www.imagemagick.org.

I retried the code I posted.
this time it passed, but there are some problems:
1) The resulting PDF is in much lower quality then when running the convert utility on the same file.
2) The resulting PDF is in much larger (both file size and page size) then when running the convert utility on the same file.
3) both convert and my code takes up to 10 seconds to convert a regular 1 page tiff. in the previous version (6.2.8) it took about 290 MSecs.
what am I doing wrong?

Thanks,
Ronen.

Re: TIFF to PDF conversion

Posted: 2007-02-19T00:04:59-07:00
by rperez
Hi All,
anyone has any idea about why in library version 6.3.2 conversion of TIFF to PDF has poor quality and performance?

I'll appreciate any input that could help.
Thanks,

Ronen.