HI,
I'm trying to convert multiple images to one single pdf with MagicWand in C code.
I can save one image to one pdf file.
But I can't find a way to load all images in one container or some object to save the raster image data.
Is anybody has the code flow or API of MagicWand that I can call to load all image to one Object or container?
Any suggestions?
THX
convert multiple images to single pdf with library MagicWand
-
- Posts: 2
- Joined: 2018-08-12T23:15:20-07:00
- Authentication code: 1152
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: convert multiple images to single pdf with library MagicWand
Here's a wand program, but with no error-checking, that writes two images to a PDF:
Code: Select all
#include <MagickWand/MagickWand.h>
int main(void)
{
MagickWandGenesis();
MagickWand *mw = NewMagickWand();
MagickReadImage(mw,"rose:");
MagickWand *aw = NewMagickWand();
MagickReadImage(aw,"toes.png");
MagickAddImage(mw,aw);
MagickWriteImages(mw,"out.pdf",MagickTrue);
if(mw) mw = DestroyMagickWand(mw);
if(aw) aw = DestroyMagickWand(aw);
MagickWandTerminus();
return 0;
}
snibgo's IM pages: im.snibgo.com