Can u pls go through the below code ...in below code they r using input and output files..but as per my requirement.....i dont want input file..iam getting bytes and i have to write to meemory stream and then pass to some pdf file as input to PdfFileInfo.
string inFile = @"C:\input.PDF";
string outFile = @"C:\kit.PDF";
// create PdfFileInfo object to get PDF file information
PdfFileInfo fileInfo = new PdfFileInfo(infile);
// create Stamp object
Stamp aStamp = new Stamp();
// create a sample formatting text with Maroon as font color and text size as 50
FormattedText formatted = new FormattedText("Draft Document", System.Drawing.Color.Maroon, Aspose.Pdf.Kit.FontStyle.HelveticaBold, EncodingType.Winansi, true, 50);
aStamp.BindLogo(formatted);
aStamp.IsBackground = false;
// specify the page number over which watermark should be displayed
// aStamp.Pages = new int[] { };
// Watermark rotation angle
aStamp.Rotation = 45;
// specify the opacity value for watermark
aStamp.Opacity = 0.5F;
//specifies the position of stamp
aStamp.SetOrigin(fileInfo.GetPageWidth(1) / 3, fileInfo.GetPageHeight(1) / 2);
PdfFileStamp stamper = new PdfFileStamp(inFile, outFile);
stamper.AddStamp(aStamp);
stamper.Close();