public static void Run()
        {
            try
            {
                // ExStart:GetButtonOptionValue
                // The path to the documents directory.
                string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

                // Create Form Object
                Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();

                // Open Document
                pdfForm.BindPdf(dataDir + "FormField.pdf");

                // Get button option values
                var optionValues = pdfForm.GetButtonOptionValues("Gender");

                IDictionaryEnumerator optionValueEnumerator = optionValues.GetEnumerator();

                while (optionValueEnumerator.MoveNext())
                {
                    Console.WriteLine("Key : {0} , Value : {1} ", optionValueEnumerator.Key, optionValueEnumerator.Value);
                }
                // ExEnd:GetButtonOptionValue
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        public static void Run()
        {
            try
            {
                // ExStart:GetButtonOptionValue
                // The path to the documents directory.
                string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

                // Create Form Object
                Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();

                // Open Document
                pdfForm.BindPdf(dataDir + "FormField.pdf");

                // Get button option values
                var optionValues = pdfForm.GetButtonOptionValues("Gender");

                IDictionaryEnumerator optionValueEnumerator = optionValues.GetEnumerator();

                while (optionValueEnumerator.MoveNext())
                    Console.WriteLine("Key : {0} , Value : {1} ", optionValueEnumerator.Key, optionValueEnumerator.Value);
                // ExEnd:GetButtonOptionValue
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
        public static void Run()
        {
            // ExStart:GetFormFieldValue
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

            // Create Form Object
            Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();

            // Open Document
            pdfForm.BindPdf(dataDir + "FormField.pdf");

            // Get form field facade
            FormFieldFacade fieldFacade = pdfForm.GetFieldFacade("textfield");

            // Get facade values
            Console.WriteLine("Alignment : {0} ", fieldFacade.Alignment);
            Console.WriteLine("Background Color : {0} ", fieldFacade.BackgroundColor);
            Console.WriteLine("Border Color : {0} ", fieldFacade.BorderColor);
            Console.WriteLine("Border Style : {0} ", fieldFacade.BorderStyle);
            Console.WriteLine("Border Width : {0} ", fieldFacade.BorderWidth);
            Console.WriteLine("Box : {0} ", fieldFacade.Box);
            Console.WriteLine("Caption : {0} ", fieldFacade.Caption);
            Console.WriteLine("Font Name : {0} ", fieldFacade.Font);
            Console.WriteLine("Font Size : {0} ", fieldFacade.FontSize);
            Console.WriteLine("Page Number : {0} ", fieldFacade.PageNumber);
            Console.WriteLine("Text Color : {0} ", fieldFacade.TextColor);
            Console.WriteLine("Text Encoding : {0} ", fieldFacade.TextEncoding);
            // ExEnd:GetFormFieldValue
        }
 public static void GetMaxFieldLimitUsingFacades()
 {
     // ExStart:GetMaxFieldLimitUsingFacades
     // The path to the documents directory.
     string dataDir = RunExamples.GetDataDir_AsposePdf_Forms();
     // Getting maximum field limit using Facades
     Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form();
     form.BindPdf(dataDir + "FieldLimit.pdf");
     Console.WriteLine("Limit: " + form.GetFieldLimit("textbox1"));
     // ExEnd:GetMaxFieldLimitUsingFacades
 }
        public static void GetMaxFieldLimitUsingFacades()
        {
            // ExStart:GetMaxFieldLimitUsingFacades
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdf_Forms();

            // Getting maximum field limit using Facades
            Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form();
            form.BindPdf(dataDir + "FieldLimit.pdf");
            Console.WriteLine("Limit: " + form.GetFieldLimit("textbox1"));
            // ExEnd:GetMaxFieldLimitUsingFacades
        }
        public static void Run()
        {
            // ExStart:GetFieldValue
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

            Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();
            // Open Document
            pdfForm.BindPdf(dataDir + "input.pdf");

            // Get field value
            Console.WriteLine("Field Value : {0} ", pdfForm.GetField("textfield"));
            // ExEnd:GetFieldValue
        }
        public static void Run()
        {
            // ExStart:FlattenAllFields
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

            Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();
            // Open Document
            pdfForm.BindPdf(dataDir + "input.pdf");

            // Flatten fields
            pdfForm.FlattenAllFields();

            // Save output
            pdfForm.Save( dataDir + "FlattenAllFields_out.pdf");
            // ExEnd:FlattenAllFields
        }
        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()
        {
            // 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()
        {
            // ExStart:FlattenAllFields
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

            Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();
            // Open Document
            pdfForm.BindPdf(dataDir + "input.pdf");

            // Flatten fields
            pdfForm.FlattenAllFields();

            // Save output
            pdfForm.Save(dataDir + "FlattenAllFields_out_.pdf");
            // ExEnd:FlattenAllFields
        }
        public static void GetCurrentValue()
        {
            // ExStart:GetCurrentValue
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

            // Create Form Object
            Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();

            // Open Document
            pdfForm.BindPdf(dataDir + "FormField.pdf");

            // Get button option values
            string optionValue = pdfForm.GetButtonOptionCurrentValue("Gender");

            Console.WriteLine("Current Value : {0} ", optionValue);
            // ExEnd:GetCurrentValue
        }
        public static void GetCurrentValue()
        {
            // ExStart:GetCurrentValue
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

            // Create Form Object
            Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();

            // Open Document
            pdfForm.BindPdf(dataDir + "FormField.pdf");

            // Get button option values
            string optionValue = pdfForm.GetButtonOptionCurrentValue("Gender");

            Console.WriteLine("Current Value : {0} ", optionValue);
            // ExEnd:GetCurrentValue
        }
Esempio n. 13
0
        public PdfModelProcessor(byte[] pdfContent)
        {
            license = new License();
            DocsPaDB.Query_DocsPAWS.ClientSideModelProcessor csmp = new DocsPaDB.Query_DocsPAWS.ClientSideModelProcessor();

            byte[] licenseContent = csmp.GetLicense("ASPOSE");
            if (licenseContent != null)
            {
                System.IO.MemoryStream licenseStream = new System.IO.MemoryStream(licenseContent, 0, licenseContent.Length);
                license.SetLicense(licenseStream);
                licenseStream.Close();
            }

            MemoryStream ms = new MemoryStream(pdfContent);

            form = new Form();
            form.BindPdf(ms);
        }
Esempio n. 14
0
        public static void Run()
        {
            // ExStart:FillFormFieldF
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

            // Create Form Object
            Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();

            // Open Document
            pdfForm.BindPdf(dataDir + "FormField.pdf");

            // Fill the field "textfield" with "Mike".
            pdfForm.FillField("textfield", "Mike");

            // Save updated file
            pdfForm.Save(dataDir + "FillFormFieldF_out_.pdf");
            // ExEnd:FillFormFieldF
        }
        public static void Run()
        {
            // ExStart:FillFormFieldF
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

            // Create Form Object
            Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();

            // Open Document
            pdfForm.BindPdf(dataDir + "FormField.pdf");

            // Fill the field "textfield" with "Mike".
            pdfForm.FillField("textfield", "Mike");                    
            
            // Save updated file
            pdfForm.Save( dataDir + "FillFormFieldF_out.pdf");
            // ExEnd:FillFormFieldF
        }
        public static void Run()
        {
            // ExStart:ImportDataFromPdf
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

            Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form();
            // Open Document
            form.BindPdf(dataDir + "input.pdf");

            // Open fdf file.
            System.IO.FileStream fdfInputStream = new FileStream(dataDir + "student.fdf", FileMode.Open);

            // Import data
            form.ImportFdf(fdfInputStream);

            // Close file stream
            fdfInputStream.Close();

            // Save updated document
            form.Save(dataDir + "ImportDataFromPdf_out.pdf");
            // ExEnd:ImportDataFromPdf
        }
        public static void Run()
        {
            // ExStart:ExportDataToPdf
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

            Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form();
            // Open Document
            form.BindPdf(dataDir + "input.pdf");

            // Create fdf file.
            System.IO.FileStream fdfOutputStream = new FileStream(dataDir + "student.fdf", FileMode.Create);

            // Export data
            form.ExportFdf(fdfOutputStream);

            // Close file stream
            fdfOutputStream.Close();

            // Save updated document
            form.Save(dataDir + "ExportDataToPdf_out.pdf"); 
            // ExEnd:ExportDataToPdf
        }        
        public static void Run()
        {
            // ExStart:ImportDataFromXFDF
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

            Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form();
            // Open Document
            form.BindPdf(dataDir + "input.pdf");

            // Open xfdf file.
            System.IO.FileStream xfdfInputStream = new FileStream("student1.xfdf", FileMode.Open);

            // Import data
            form.ImportXfdf(xfdfInputStream);

            // Close file stream
            xfdfInputStream.Close();

            // Save updated document
            form.Save(dataDir + "ImportDataFromXFDF_out.pdf");
            // ExEnd:ImportDataFromXFDF
        }        
        public static void Run()
        {
            // ExStart:ExportDataToXFDF
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

            Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form();
            // Open Document
            form.BindPdf(dataDir + "input.pdf");

            // Create xfdf file.
            System.IO.FileStream xfdfOutputStream = new FileStream("student1.xfdf", FileMode.Create);

            // Export data
            form.ExportXfdf(xfdfOutputStream);

            // Close file stream
            xfdfOutputStream.Close();

            // Save updated document
            form.Save(dataDir + "ExportDataToXFDF_out_.pdf");
            // ExEnd:ExportDataToXFDF
        }
        public static void Run()
        {
            // ExStart:ExportDataToXML
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

            // Open document
            Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form();

            form.BindPdf(dataDir + "input.pdf");

            // Create xml file.
            System.IO.FileStream xmlOutputStream = new FileStream( dataDir + "input.xml", FileMode.Create);

            // Export data
            form.ExportXml(xmlOutputStream);

            // Close file stream
            xmlOutputStream.Close();

            // Close the document
            form.Dispose();
            // ExEnd:ExportDataToXML
        }        
        public static void Run()
        {
            // ExStart:ExportDataToXML
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Forms();

            // Open document
            Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form();

            form.BindPdf(dataDir + "input.pdf");

            // Create xml file.
            System.IO.FileStream xmlOutputStream = new FileStream(dataDir + "input.xml", FileMode.Create);

            // Export data
            form.ExportXml(xmlOutputStream);

            // Close file stream
            xmlOutputStream.Close();

            // Close the document
            form.Dispose();
            // ExEnd:ExportDataToXML
        }
Esempio n. 22
0
 public static Aspose.Pdf.Facades.Form LoadPDFDoc()
 {
     Aspose.Pdf.Facades.Form pdfForm = new Aspose.Pdf.Facades.Form();
     pdfForm.BindPdf(Directory.GetParent(Environment.CurrentDirectory).Parent.Parent.FullName + "\\SampleDoc\\PdfFormSample.pdf");
     return pdfForm;
 }