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() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Images(); //open document PdfFileMend mender = new PdfFileMend(); //create PdfFileMend object to add text mender.BindPdf(dataDir + "AddImage.pdf"); //add image in the PDF file mender.AddImage(dataDir+ "aspose-logo.jpg", 1, 100, 600, 200, 700); //save changes mender.Save(dataDir + "AddImage_out.pdf"); //close PdfFileMend object mender.Close(); }
public static void Run() { // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdfFacades_Images(); //open document PdfFileMend mender = new PdfFileMend(); //create PdfFileMend object to add text mender.BindPdf(dataDir + "AddImage.pdf"); //add image in the PDF file mender.AddImage(dataDir + "aspose-logo.jpg", 1, 100, 600, 200, 700); //save changes mender.Save(dataDir + "AddImage_out.pdf"); //close PdfFileMend object mender.Close(); }
public static void Run() { // ExStart:AddBarcodeImageToPDFDocument // For complete examples and data files, please go to https://github.com/aspose-barcode/Aspose.BarCode-for-.NET // The path to the documents directory. string dataDir = RunExamples.GetDataDir_TechnicalArticles(); // Instantiate linear barcode object, Set the Code text and symbology type for the barcode BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.Code39Standard, "1234567"); // Creating memory stream and Saving barcode image to memory stream System.IO.Stream ms = new System.IO.MemoryStream(); generator.Save(ms, BarCodeImageFormat.Bmp); // ExStart:CreatePdfDocument // Create Pdf document and Add a section to the Pdf document Document doc = new Document(); doc.Pages.Add(); // ExEnd:CreatePdfDocument // Open document PdfFileMend mender = new PdfFileMend(); // Create PdfFileMend object to add barcode image mender.BindPdf(doc); // Add image in the PDF file mender.AddImage(ms, 1, 100, 600, 200, 700); // Save changes mender.Save(dataDir + "AddImage_out.pdf"); // Close PdfFileMend object mender.Close(); // ExEnd:AddBarcodeImageToPDFDocument Console.WriteLine(Environment.NewLine + "Add BarCode Image To PDF Document Finished."); }