PDF to PDF multipage

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
Isleo
Posts: 4
Joined: 2014-12-23T03:48:23-07:00
Authentication code: 6789

PDF to PDF multipage

Post by Isleo »

Hello,

I'm trying to convert a PDF to a new PDF (with changes; threshold). The code is something like this:

Code: Select all


  string final = dir/someName.pdf;

  MagickReadImage(m_wand,final.c_str());
  MagickSetImageFormat(m_wand, "fax");

  int umbraln = 80;

  if (umbraln != 0)
    MagickThresholdImage(m_wand, (double)umbraln*(QuantumRange/100));
  else
    MagickThresholdImage(m_wand, (double)-1);

  MagickWriteImage(m_wand,"/dir/newPDF.pdf");

  ClearMagickWand(m_wand);
If I do that with a multipage PDF, it only makes a new pdf with the last page converted. Any help?

Kind regards,

Isleo.
Isleo
Posts: 4
Joined: 2014-12-23T03:48:23-07:00
Authentication code: 6789

Re: PDF to PDF multipage

Post by Isleo »

Autoanswer: MagickWriteImages(m_wand, dir/newFile.pdf,MagickTrue);
Post Reply