Hi,
I now believe the issue is not related to the software version but to the Document model that I am using to create my PDF.
I have created a very simple C# .Net Website. In my Global.asax file I have placed the following code:
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense("Aspose.Pdf.lic");
}
I have two buttons on my Default page. The first button takes a multi frame (4) tif file and creates a 4 page PDF based on the tif file contents. For this button I am using the Aspose.PDF.Document class to generate the PDF. This results in an Evaluation watermark appearing in the top left hand corner of the PDF.
The second button takes the same multi frame (4) tif file and creates a 4 page PDF based on the tif file contents. For this button I am using the Aspose.PDF.Generator class to generate the PDF. This results in no Evaluation watermark appearing in the top left hand corner. Below is my code for each button click.
Incidentally there is a bug in the Generator class whereby the PageInfo settings are only applied to the first page when converting a multi frame tif image (you will notice that pages 2, 3 and 4 are a different size to page 1 in this example). This is why I am having to use the Document class and encountered this issue.
Also, when I comment out my License file SetLicense section so that no license is applied, an additional watermark appears (in red) within the PDF. I have attached an example of this along with the pdf files created when the license code is applied.
protected void btnConvert_Click(object sender, EventArgs e)
{
// Create a new bitmap image to get the dimensions and other image details
Bitmap b = new Bitmap(@"C:\Temp\28-10-2015_3268000932101455.tif");
lblProgress.Text = "Bitmap Loaded....";
//New document
Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
lblProgress.Text = "Aspose Document Object created....";
//Add a page to the document
Aspose.Pdf.Page page = doc.Pages.Add();
lblProgress.Text = "Page added to document....";
//Set PDF document Page settings
page.PageInfo.Margin.Top = 0;
page.PageInfo.Margin.Bottom = 0;
page.PageInfo.Margin.Left = 0;
page.PageInfo.Margin.Right = 0;
page.PageInfo.Width = b.Width;
page.PageInfo.Height = b.Height;
lblProgress.Text = "Page settings applied....";
//Create an image object
Aspose.Pdf.Image image1 = new Aspose.Pdf.Image();
lblProgress.Text = "PDF Image object created....";
//Add image object to the Paragraph collection
page.Paragraphs.Add(image1);
lblProgress.Text = "Image object added to Paragraph....";
//Set image properties
image1.IsBlackWhite = true;
image1.FixWidth = page.PageInfo.Width;
image1.FixHeight = page.PageInfo.Height;
lblProgress.Text = "Image properties set....";
image1.File = @"C:\Temp\07-05-2015_3268000932101831.tif";
lblProgress.Text = "Image file path set....";
//Save the PDF
doc.Save("C:\\Temp\\AsposeDocumentTest.pdf");
lblProgress.Text = "PDF saved....";
//Clean bitmap image
b.Dispose();
}
protected void btnConvert1_Click(object sender, EventArgs e)
{
// Create a new bitmap image to get the dimensions and other image details
Bitmap b = new Bitmap(@"C:\Temp\28-10-2015_3268000932101455.tif");
lblProgress.Text = "Bitmap Loaded....";
//Instantiate a PDF Object
Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();
pdf1.PageSetup.PageWidth = b.Width;
pdf1.PageSetup.PageHeight = b.Height;
//Create a section in the PDF Object
Aspose.Pdf.Generator.Section sec1 = new Aspose.Pdf.Generator.Section(pdf1);
//Set the margins
sec1.PageInfo.Margin.Top = 0;
sec1.PageInfo.Margin.Bottom = 0;
sec1.PageInfo.Margin.Left = 0;
sec1.PageInfo.Margin.Right = 0;
//Set Page size to match image
sec1.PageInfo.PageWidth = b.Width;
sec1.PageInfo.PageHeight = b.Height;
//Add the section to the sections collection
pdf1.Sections.Add(sec1);
//Create an Image object in the section
Aspose.Pdf.Generator.Image image1 = new Aspose.Pdf.Generator.Image(sec1);
//Add image object in the Paragraph collection of the section
sec1.Paragraphs.Add(image1);
//SEt the Image type
image1.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Tiff;
image1.ImageInfo.TiffFrame = -1;
image1.ImageInfo.IsAllFramesInNewPage = true;
//set image to match page size
image1.ImageWidth = sec1.PageInfo.PageWidth;
image1.ImageHeight = sec1.PageInfo.PageHeight;
//Attempt to gain a performance improvement by forcing the Tif image to be black and white
image1.ImageInfo.IsBlackWhite = true;
//set the path of the image file
image1.ImageInfo.File = @"C:\Temp\07-05-2015_3268000932101831.tif";
//save the PDF
pdf1.Save("C:\\Temp\\AsposeGeneratorTest.pdf");
}protected void btnConvert_Click(object sender, EventArgs e)
{
// Create a new bitmap image to get the dimensions and other image details
Bitmap b = new Bitmap(@"C:\Temp\28-10-2015_3268000932101455.tif");
lblProgress.Text = "Bitmap Loaded....";
//New document
Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
lblProgress.Text = "Aspose Document Object created....";
//Add a page to the document
Aspose.Pdf.Page page = doc.Pages.Add();
lblProgress.Text = "Page added to document....";
//Set PDF document Page settings
page.PageInfo.Margin.Top = 0;
page.PageInfo.Margin.Bottom = 0;
page.PageInfo.Margin.Left = 0;
page.PageInfo.Margin.Right = 0;
page.PageInfo.Width = b.Width;
page.PageInfo.Height = b.Height;
lblProgress.Text = "Page settings applied....";
//Create an image object
Aspose.Pdf.Image image1 = new Aspose.Pdf.Image();
lblProgress.Text = "PDF Image object created....";
//Add image object to the Paragraph collection
page.Paragraphs.Add(image1);
lblProgress.Text = "Image object added to Paragraph....";
//Set image properties
image1.IsBlackWhite = true;
image1.FixWidth = page.PageInfo.Width;
image1.FixHeight = page.PageInfo.Height;
lblProgress.Text = "Image properties set....";
image1.File = @"C:\Temp\07-05-2015_3268000932101831.tif";
lblProgress.Text = "Image file path set....";
//Save the PDF
doc.Save("C:\\Temp\\AsposeDocumentTest.pdf");
lblProgress.Text = "PDF saved....";
//Clean bitmap image
b.Dispose();
}
protected void btnConvert1_Click(object sender, EventArgs e)
{
// Create a new bitmap image to get the dimensions and other image details
Bitmap b = new Bitmap(@"C:\Temp\28-10-2015_3268000932101455.tif");
lblProgress.Text = "Bitmap Loaded....";
//Instantiate a PDF Object
Aspose.Pdf.Generator.Pdf pdf1 = new Aspose.Pdf.Generator.Pdf();
pdf1.PageSetup.PageWidth = b.Width;
pdf1.PageSetup.PageHeight = b.Height;
//Create a section in the PDF Object
Aspose.Pdf.Generator.Section sec1 = new Aspose.Pdf.Generator.Section(pdf1);
//Set the margins
sec1.PageInfo.Margin.Top = 0;
sec1.PageInfo.Margin.Bottom = 0;
sec1.PageInfo.Margin.Left = 0;
sec1.PageInfo.Margin.Right = 0;
//Set Page size to match image
sec1.PageInfo.PageWidth = b.Width;
sec1.PageInfo.PageHeight = b.Height;
//Add the section to the sections collection
pdf1.Sections.Add(sec1);
//Create an Image object in the section
Aspose.Pdf.Generator.Image image1 = new Aspose.Pdf.Generator.Image(sec1);
//Add image object in the Paragraph collection of the section
sec1.Paragraphs.Add(image1);
//SEt the Image type
image1.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Tiff;
image1.ImageInfo.TiffFrame = -1;
image1.ImageInfo.IsAllFramesInNewPage = true;
//set image to match page size
image1.ImageWidth = sec1.PageInfo.PageWidth;
image1.ImageHeight = sec1.PageInfo.PageHeight;
//Attempt to gain a performance improvement by forcing the Tif image to be black and white
image1.ImageInfo.IsBlackWhite = true;
//set the path of the image file
image1.ImageInfo.File = @"C:\Temp\07-05-2015_3268000932101831.tif";
//save the PDF
pdf1.Save("C:\\Temp\\AsposeGeneratorTest.pdf");
}