Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Writing Multiple Images to PDF

$
0
0
Hello,
I am trying to add a couple images to a PDF file and position them by the Gravity setting however when I do so they always get positioned at x=0 and y=0. I guess I can use the actual XY coordinates to position them if I have but would rather use Gravity if I can. Is there a way to use Gravity? Below is a sampling of the code I am using.
 using (MagickImageCollection PDFdoc = new MagickImageCollection())
{
    int PDFPageNumber = 0;
    string CoverFile = GlobalVar.DownloadPath + @"\Cover.tif";
        string InsideFile = GlobalVar.DownloadPath + @"\Inside.tif";
      
        PDFdoc.Read(PDFPath);
        foreach (MagickImage PDFPage in PDFdoc)
          {
            PDFPage.Density = new Density(GlobalVar.PrintPPI, GlobalVar.PrintPPI, DensityUnit.PixelsPerInch); 
        PDFPageNumber += 1;
                if (PDFPageNumber == 1)
                  {
                    PDFPage.Composite(new MagickImage(BackFile), Gravity.West, CompositeOperator.Over);
                    PDFPage.Composite(new MagickImage(CoverFile),Gravity.Northeast, CompositeOperator.Over);
                   }

           }
    PDFdoc.Write(PDFPath);
} 

Viewing all articles
Browse latest Browse all 3693

Trending Articles