Beispiel #1
0
        public static void Run()
        {
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Text();

            //open document
            PdfFileMend mender = new PdfFileMend();

            //create PdfFileMend object to add text
            mender.BindPdf(dataDir + "AddText.pdf");

            //create formatted text
            FormattedText text = new FormattedText("Aspose - Your File Format Experts!", System.Drawing.Color.AliceBlue, System.Drawing.Color.Gray, Aspose.Pdf.Facades.FontStyle.Courier, EncodingType.Winansi, true, 14);

            //set whether to use Word Wrap or not and using which mode
            mender.IsWordWrap = true;
            mender.WrapMode = WordWrapMode.Default;

            //add text in the PDF file
            mender.AddText(text, 1, 100, 200, 200, 400);

            //save changes
            mender.Save(dataDir + "AddText_out.pdf");

            //close PdfFileMend object
            mender.Close();
            
        }
        public static void Run()
        {
            // ExStart:AddText
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Text();

            // Open document
            PdfFileMend mender = new PdfFileMend();

            // Create PdfFileMend object to add text
            mender.BindPdf(dataDir + "AddText.pdf");

            // Create formatted text
            FormattedText text = new FormattedText("Aspose - Your File Format Experts!", System.Drawing.Color.AliceBlue, System.Drawing.Color.Gray, Aspose.Pdf.Facades.FontStyle.Courier, EncodingType.Winansi, true, 14);

            // Set whether to use Word Wrap or not and using which mode
            mender.IsWordWrap = true;
            mender.WrapMode   = WordWrapMode.Default;

            // Add text in the PDF file
            mender.AddText(text, 1, 100, 200, 200, 400);

            // Save changes
            mender.Save(dataDir + "AddText_out.pdf");

            // Close PdfFileMend object
            mender.Close();
            // ExEnd:AddText
        }
        public static void Run()
        {
            // ExStart:AddTextImagesUsingPdfFileMend
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_TechnicalArticles();

            // Specify input and output PDF file paths
            string inputFile = dataDir + "inFile.pdf";
            string outputFile = dataDir + "AddTextImagesUsingPdfFileMend_out.pdf";

            // Specify image file path
            string imageName = dataDir + "aspose-logo.jpg";

            // Create file streams for all of the files to be used in the example           
            FileStream inImgStream = new FileStream(@imageName, FileMode.Open);
            FileStream outputStream = new FileStream(@outputFile, FileMode.Create);

            Document doc = new Document(inputFile);
            // Create instance of PdfFileMend class
            PdfFileMend mendor = new PdfFileMend(doc);

            // Add image to the input PDF file on page number 1 at specified location
            mendor.AddImage(inImgStream, 1, 50, 50, 100, 100);

            // Create new FormattedText type object to add text in the PDF file
            FormattedText ft = new FormattedText(
            "PdfFileMend testing! 0 rotation.",
            System.Drawing.Color.FromArgb(0, 200, 0),
            FontStyle.TimesRoman,
            EncodingType.Winansi,
            false,
            12);

            // Add text in the existing PDF file
            mendor.AddText(ft, 1, 50, 100, 100, 200);

            // Claose the PdfFileMend type object
            mendor.Close();
            // Close output file stream
            outputStream.Close();
            // ExEnd:AddTextImagesUsingPdfFileMend                      
        }
        public static void Run()
        {
            // ExStart:AddTextImagesUsingPdfFileMend
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_AsposePdfFacades_TechnicalArticles();

            // Specify input and output PDF file paths
            string inputFile  = dataDir + "inFile.pdf";
            string outputFile = dataDir + "AddTextImagesUsingPdfFileMend_out_.pdf";

            // Specify image file path
            string imageName = dataDir + "aspose-logo.jpg";

            // Create file streams for all of the files to be used in the example
            FileStream inImgStream  = new FileStream(@imageName, FileMode.Open);
            FileStream outputStream = new FileStream(@outputFile, FileMode.Create);

            Document doc = new Document(inputFile);
            // Create instance of PdfFileMend class
            PdfFileMend mendor = new PdfFileMend(doc);

            // Add image to the input PDF file on page number 1 at specified location
            mendor.AddImage(inImgStream, 1, 50, 50, 100, 100);

            // Create new FormattedText type object to add text in the PDF file
            FormattedText ft = new FormattedText(
                "PdfFileMend testing! 0 rotation.",
                System.Drawing.Color.FromArgb(0, 200, 0),
                FontStyle.TimesRoman,
                EncodingType.Winansi,
                false,
                12);

            // Add text in the existing PDF file
            mendor.AddText(ft, 1, 50, 100, 100, 200);

            // Claose the PdfFileMend type object
            mendor.Close();
            // Close output file stream
            outputStream.Close();
            // ExEnd:AddTextImagesUsingPdfFileMend
        }
        public static void Main()
        {
            // The path to the documents directory.
            string dataDir = Path.GetFullPath("../../../Data/");
            //create PdfFileMend object to add text
            PdfFileMend mender = new PdfFileMend(dataDir+ "input.pdf", dataDir+ "output.pdf");

            //create formatted text
            FormattedText text = new FormattedText("Aspose - Your File Format Experts!", System.Drawing.Color.AliceBlue, System.Drawing.Color.Gray, Aspose.Pdf.Facades.FontStyle.Courier, EncodingType.Winansi, true, 14);

            //set whether to use Word Wrap or not and using which mode
            mender.IsWordWrap = true;
            mender.WrapMode = WordWrapMode.Default;

            //add text in the PDF file
            mender.AddText(text, 1, 100, 200, 200, 400);

            //close PdfFileMend object
            mender.Close();
        }
Beispiel #6
0
        public static void Main()
        {
            // The path to the documents directory.
            string dataDir = Path.GetFullPath("../../../Data/");
            //create PdfFileMend object to add text
            PdfFileMend mender = new PdfFileMend(dataDir + "input.pdf", dataDir + "output.pdf");

            //create formatted text
            FormattedText text = new FormattedText("Aspose - Your File Format Experts!", System.Drawing.Color.AliceBlue, System.Drawing.Color.Gray, Aspose.Pdf.Facades.FontStyle.Courier, EncodingType.Winansi, true, 14);

            //set whether to use Word Wrap or not and using which mode
            mender.IsWordWrap = true;
            mender.WrapMode   = WordWrapMode.Default;

            //add text in the PDF file
            mender.AddText(text, 1, 100, 200, 200, 400);

            //close PdfFileMend object
            mender.Close();
        }