Montage: how to prevent overwriting pdf?

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
architektura
Posts: 21
Joined: 2016-10-03T05:11:21-07:00
Authentication code: 1151

Montage: how to prevent overwriting pdf?

Post by architektura » 2017-07-19T23:25:16-07:00

Hello,
how can I prevent overwriting pdf in Montage?
I use Your script - and every time if I want use "Montage" pdf is overwite but if I use
images.Write(filepath) insteed - I get multipage pdf (but I cant use this format of picture)

Code: Select all

List<string> lFiles = new List<string>();
foreach (String filename in openFileDialog1.FileNames)
lFiles.Add(filename);

using (MagickImageCollection images = new MagickImageCollection())
{

int sizer = 300;
foreach (string tempFile in lFiles)
{

MagickImage magickinput = new MagickImage(tempFile);

magickinput.Quality = 70;
if (magickinput.Height > magickinput.Width)
{
magickinput.Rotate(90);
}
magickinput.Resize(sizer, 0);
magickinput.CompressionMethod = CompressionMethod.JPEG;
images.Add(magickinput);
}
tempWidth = 842 ;
tempHeight = 595 ;

MontageSettings ms = new MontageSettings();
ms.BorderWidth = 10;
ms.Geometry = new MagickGeometry(2, 2, tempWidth, tempHeight);
ms.TileGeometry = new MagickGeometry(2, 2);
ms.Label = Path.Combine(Path.GetFileName(imageFileName));


using (MagickImage montageResult = images.Montage(ms))
{ 
montageResult.Write(imageFileName); //image with path
}
thanks
ala

architektura
Posts: 21
Joined: 2016-10-03T05:11:21-07:00
Authentication code: 1151

Re: Montage: how to prevent overwriting pdf?

Post by architektura » 2017-07-21T00:17:15-07:00

resolved!

:)

Post Reply