public static void Run() { // ExStart:DecorateFields // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms(); // Open document FormEditor form = new FormEditor(); // Open the document and create a FormEditor object form.BindPdf(dataDir + "DecorateFields.pdf"); // Create a new facade object FormFieldFacade facade = new FormFieldFacade(); // Assign the facade to form editor form.Facade = facade; // Set the backgroud color as red facade.BackgroundColor = System.Drawing.Color.Red; // Set the alignment as center facade.Alignment = FormFieldFacade.AlignCenter; // All text fields will be modified: form.DecorateField(FieldType.Text); // Close and validate the modification like this: form.Save(dataDir + "DecorateFields_out_.pdf"); // ExEnd:DecorateFields }
public static void Run() { // ExStart:DecorateFields // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms(); // Open document FormEditor form = new FormEditor(); // Open the document and create a FormEditor object form.BindPdf(dataDir + "DecorateFields.pdf"); // Create a new facade object FormFieldFacade facade = new FormFieldFacade(); // Assign the facade to form editor form.Facade = facade; // Set the backgroud color as red facade.BackgroundColor = System.Drawing.Color.Red; // Set the alignment as center facade.Alignment = FormFieldFacade.AlignCenter; // All text fields will be modified: form.DecorateField(FieldType.Text); // Close and validate the modification like this: form.Save(dataDir + "DecorateFields_out.pdf"); // ExEnd:DecorateFields }
public static void Run() { // ExStart:JustifyText // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_TechnicalArticles(); using (FileStream source = File.Open(dataDir + "Input1.pdf", FileMode.Open)) { MemoryStream ms = new MemoryStream(); // Create Form Object Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form(); // Open Source File form.BindPdf(source); // Fill Text Field form.FillField("Text1", "Thank you for using Aspose"); // Save the document in Memory Stream form.Save(ms); ms.Seek(0, SeekOrigin.Begin); FileStream dest = new FileStream(dataDir + "JustifyText_out.pdf", FileMode.Create); // Create formEditor Object FormEditor formEditor = new FormEditor(); // Open PDF from memory stream formEditor.BindPdf(ms); // Set Text Alignment as Justified formEditor.Facade.Alignment = FormFieldFacade.AlignJustified; // Decorate form field. formEditor.DecorateField(); // Save te resultant file. formEditor.Save(dest); // Close file stream dest.Close(); } // ExEnd:JustifyText }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms(); //create FormEditor object and open PDF file FormEditor form = new FormEditor(dataDir+ "input_form.pdf", dataDir+ "DecorateFields_out.pdf"); //create a new facade object FormFieldFacade facade = new FormFieldFacade(); //assign the facade to form editor form.Facade = facade; //set the backgroud color as red facade.BackgroundColor = System.Drawing.Color.Red; //set the alignment as center facade.Alignment = FormFieldFacade.AlignCenter; //all text fields will be modified: form.DecorateField(FieldType.Text); //close and validate the modification like this: form.Save(); }
public static void Main() { // The path to the documents directory. string dataDir = Path.GetFullPath("../../../Data/"); //create FormEditor object and open PDF file FormEditor form = new FormEditor(dataDir + "input_form.pdf", dataDir + "output.pdf"); //create a new facade object FormFieldFacade facade = new FormFieldFacade(); //assign the facade to form editor form.Facade = facade; //set the backgroud color as red facade.BackgroundColor = System.Drawing.Color.Red; //set the alignment as center facade.Alignment = FormFieldFacade.AlignCenter; //all text fields will be modified: form.DecorateField(FieldType.Text); //close and validate the modification like this: form.Save(); }
public static void Run() { // ExStart:DecorateParticularField // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms(); FormEditor form = new FormEditor(); // Open the document and create a FormEditor object form.BindPdf(dataDir + "input.pdf"); // Set field facade FormFieldFacade fieldFacade = new FormFieldFacade(); form.Facade = fieldFacade; fieldFacade.BackgroundColor = System.Drawing.Color.Red; fieldFacade.FontSize = 14; // Specify the form field which needs to be decorated form.DecorateField("textfield"); // Save updated PDF form form.Save(dataDir + "DecorateParticularField_out.pdf"); // ExEnd:DecorateParticularField }