I'm trying to convert a tiff image to a pdf image. The tiff file is a tiffG4
It look okej but the pdf is not redable in adobe acrobat reader.
Do i do anny thing wrong ??
MagickWandGenesis();
wand = NewMagickWand();
status = MagickReadImage(wand,"c:\\1.tif");
status = MagickSetImageFormat(wand, "PDF" );
MagickGetImageBlob(wand,&ImageLen);
memcpy(*Image,FilePonter,ImageLen);
DestroyMagickWand( wand );
MagickWandTerminus();
infd = open("c:\\1.pdf", O_RDWR | O_CREAT);
write(infd,Image,ImageLen);
close(infd);
Convert tiff -> pdf
Re: Convert tiff -> pdf
This snippet reads an image in the TIFF format, converts it to PDF as an inline blob, and writes the result to disk:
- wand = NewMagickWand();
status = MagickReadImage(wand,"1.tif");
status = MagickSetImageFormat(wand, "PDF" );
blob = MagickGetImageBlob(wand,&length);
DestroyMagickWand( wand );
MagickWandTerminus();
infd = open("1.pdf", O_RDWR | O_CREAT, 0644);
write(infd,blob,length);
close(infd);
Re: Convert tiff -> pdf
I copy your code and test it on my image. Iget one pdf but is not okej to display in acrobar reader.
I run the convert program on it, then it work ok.
My image is tiff tiffG4 black&white ( no grayscale or collor )
I test this under windows.
Version: ImageMagick 6.3.7 12/25/07 Q8
I run the convert program on it, then it work ok.
My image is tiff tiffG4 black&white ( no grayscale or collor )
I test this under windows.
Version: ImageMagick 6.3.7 12/25/07 Q8
Re: Convert tiff -> pdf
Can you post a URL to your image, 1.tif? We converted a G4 TIFF image with the MagickWand program and the convert command and both produced a valid PDF image. We're using ImageMagick 6.3.7-9.
Re: Convert tiff -> pdf
I have 2 test images on a webserver
http://ropet.mine.nu/Images/
001.TIF
002.TIF
thanks for all help i can get
http://ropet.mine.nu/Images/
001.TIF
002.TIF
thanks for all help i can get
Re: Convert tiff -> pdf
We tried your script with 001.TIF and 002.TIF and create 001.PDF and 002.PDF respectively and they both displayed without complaint with Adobe Acrobat 8.0. We're using ImageMagick 6.3.7-9.
Re: Convert tiff -> pdf
This is my test program i get a pdf fil thet is blank ( white )
Code: Select all
int main(int argc,char **argv)
{
int ImageLen =0;
int infd;
MagickWand *wand;
unsigned char *blob;
size_t length;
MagickBooleanType status;
MagickWandGenesis();
wand = NewMagickWand();
status = MagickReadImage(wand,"c:\\tewmp\\001.tif");
status = MagickSetImageFormat(wand, "PDF" );
blob = MagickGetImageBlob(wand,&length);
infd = open("c:\\tewmp\\1.pdf", O_RDWR | O_CREAT, 0644);
write(infd,blob,length);
close(infd);
DestroyMagickWand( wand );
MagickWandTerminus();
}
Last edited by ropet on 2008-01-08T15:39:02-07:00, edited 1 time in total.
Re: Convert tiff -> pdf
Download http://www.virginimage.org/download/1.pdf, created with your code snippet.
Re: Convert tiff -> pdf
I get the last version and make the test. And My pdf files is on
ropet.mine.nu/images
001.pdf
002.pdf
And they is not så god.
I runing under windows and vc++ 6
I have test Q8 and Q16
I see in the pdf file is generated whith Q16
ropet.mine.nu/images
001.pdf
002.pdf
And they is not så god.
I runing under windows and vc++ 6
I have test Q8 and Q16
I see in the pdf file is generated whith Q16