In case of any further query, please feel free to contact. We are sorry for your inconvenience.
//open document<o:p></o:p>
Aspose.Pdf.Facades.PdfFileStamp
fileStamp2 = new Aspose.Pdf.Facades.PdfFileStamp();
fileStamp2.BindPdf(@"c:\pdftest\HighLight_example_out.pdf");
//Instantiate a stamp object
Aspose.Pdf.Facades.Stamp
logoStamp2 = new Aspose.Pdf.Facades.Stamp();
//Instantiate an object of
FormattedText class
Aspose.Pdf.Facades.FormattedText
formatText2 = new Aspose.Pdf.Facades.FormattedText("",
System.Drawing.Color.Black, System.Drawing.Color.White, Aspose.Pdf.Facades.FontStyle.Helvetica, EncodingType.Winansi,
false, 8);
//Add another line for Stamp
formatText2.AddNewLineText("");
float Space = .3F;
formatText2.AddNewLineText("Electronic
Supporting Information files are available without a subscription to ACS Web
Editions. The American Chemical Society
", Space);
formatText2.AddNewLineText("holds
a copyright ownership interest in any copyrightable Supporting Information.
Files available from the ACS website may be
", Space);
formatText2.AddNewLineText("downloaded
for personal use only. Users are not otherw ise permitted to reproduce,
republish, redistribute, or sell any Supporting ", Space);
formatText2.AddNewLineText("Information
from the ACS website, either in whole or in part, in either machine-readable
form or any other form without permission ", Space);
formatText2.AddNewLineText("from
the American Chemical Society. For permission to reproduce, republish and
redistribute this material, requesters must process ", Space);
formatText2.AddNewLineText("their
own requests via the RightsLink permission system. Information about how to use
the RightsLink permission system can be
", Space);
formatText2.AddNewLineText("found
at ", Space);
//BindLogo to PDF
logoStamp2.BindLogo(formatText2);
logoStamp2.SetOrigin(40, 125);
logoStamp2.IsBackground = false;
//
logoStamp2.Opacity = 0.7F;
int[] j = { 1 };
logoStamp2.Pages = j;
//add stamp to PDF file
fileStamp2.AddStamp(logoStamp2);
// create MemoryStream object to hold
stamped file
MemoryStream stream = new
MemoryStream();
// save the document with text
watermark
//fileStamp2.Save(@"c:\pdftest\Aspose_Test_Stamped.pdf");
fileStamp2.Save(stream);
//save updated PDF file
fileStamp2.Close();
//open document
Document pdfDocument = new Document(stream);
//get particular page
Page pdfPage = (Page)pdfDocument.Pages[1];
//create text fragment
TextFragment textFragment1 = new TextFragment("Terms & Conditions");
textFragment1.Position = new
Position(40, 195);
//set text properties
textFragment1.TextState.FontSize = 10;
textFragment1.TextState.Font = FontRepository.FindFont("Arial");
textFragment1.TextState.FontStyle = FontStyles.Bold;
// create TextBuilder object
TextBuilder textBuilder2 = new TextBuilder(pdfPage);
// append the text fragment to the PDF
page
textBuilder2.AppendText(textFragment1);
//create text fragment
TextFragment textFragment = new TextFragment("http://pubs.acs.org/page/copyright/permissions.html");
textFragment.Position = new
Position(70, 125);
//set text properties
textFragment.TextState.FontSize = 8;
textFragment.TextState.Font = FontRepository.FindFont("Arial");
textFragment.TextState.ForegroundColor =
System.Drawing.Color.Blue;
// create TextBuilder object
TextBuilder textBuilder = new TextBuilder(pdfPage);
// append the text fragment to the PDF
page
textBuilder.AppendText(textFragment);
PdfContentEditor editor = new
PdfContentEditor();
//editor.BindPdf("c:/pdftest/Doc1.pdf");
editor.BindPdf(pdfDocument);
// create line annotation in PDF file
editor.CreateLine(new
System.Drawing.Rectangle(70, 123, 380, 110),
"", 70, 123, 255, 123, 1, 1,
System.Drawing.Color.Blue, "U", new
int[] { 2, 3 }, new
string[] { "None",
"None" });
// save the updated document
editor.Save("c:/pdftest/Correct_Stamped_output.pdf");