Page 1 of 1

PDF to PDF multipage

Posted: 2014-12-30T03:18:58-07:00
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.

Re: PDF to PDF multipage

Posted: 2014-12-30T04:08:10-07:00
by Isleo
Autoanswer: MagickWriteImages(m_wand, dir/newFile.pdf,MagickTrue);