Hello,
I am using Aspose.Pdf to convert tifs to pdf with this code:
foreach (string tif in tifs){
using (Bitmap bmp = (Bitmap) Image.FromFile(tif)){
Aspose.Pdf.
Section section1 = pdf.Sections.Add();
// creat an image object
Aspose.Pdf.
Image image1 = new Aspose.Pdf.Image(section1);
image1.ImageInfo.File = tif;
image1.ImageInfo.ImageFileType =
ImageFileType.Tiff;
if (bmp.Width > bmp.Height){
section1.IsLandscape =
true;
pdf.PageSetup.Margin.Bottom = 0;
pdf.PageSetup.Margin.Top = 0;
pdf.PageSetup.Margin.Left = 0;
pdf.PageSetup.Margin.Right = 0;
}
else{
section1.IsLandscape =
false;
pdf.PageSetup.Margin.Bottom = 0;
pdf.PageSetup.Margin.Top = 0;
pdf.PageSetup.Margin.Left = 0;
pdf.PageSetup.Margin.Right = 0;
}
// add the image to paragraphs collection of the PDF document
section1.Paragraphs.Add(image1);
}
}
pdf.Save(pdfFile);
All my pdf pages are A4, the Margin for the first page is different and it is smaller than the other pages.
can you please help me in solving this problem?
Thanks a lot
Mohamed
v