Thanks Aslam for your reply. I have received the temporary license and the existing problem has been resolved. But now the issue is and adding the watermark the document is not opening. We are doing a POC for our existing customer. Please find the attachemt of the error.
Find the following code below
using (Stream inputStream = new MemoryStream(content))
{
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense("C:\\Aspose.Pdf.lic");
Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(inputStream);
MemoryStream outStream = new MemoryStream();
// foreach (Aspose.Pdf.Page pdfPage in pdfDocument.Pages-1)
for (int i=1;i<=pdfDocument.Pages.Count;i++)
{
Aspose.Pdf.Facades.FormattedText obj = new Aspose.Pdf.Facades.FormattedText(watermark, System.Drawing.Color.Brown, Aspose.Pdf.Facades.FontStyle.HelveticaBold, Aspose.Pdf.Facades.EncodingType.Cp1252,true,20);
Aspose.Pdf.Page pdfPage = pdfDocument.Pages[i];
//create text stamp
Aspose.Pdf.TextStamp textStamp = new Aspose.Pdf.TextStamp(obj);
//set whether stamp is background
textStamp.Background = false;
textStamp.Opacity = 0.2F;
pdfPage.AddStamp(textStamp);
}
pdfDocument.Save(outStream);
content = outStream.ToArray();
Thanks & Rergards
Sonjay