public static void Run() { //ExStart:CustomOptionsPDFConversion // The path to the documents directory. string dataDir = RunExamples.GetDataDir_Conversion(); // Instantiate a Presentation object that represents a presentation file using (Presentation pres = new Presentation(dataDir + "ConvertToPDF.pptx")) { // Instantiate the PdfOptions class PdfOptions pdfOptions = new PdfOptions(); // Set Jpeg Quality pdfOptions.JpegQuality = 90; // Define behavior for metafiles pdfOptions.SaveMetafilesAsPng = true; // Set Text Compression level pdfOptions.TextCompression = PdfTextCompression.Flate; // Define the PDF standard pdfOptions.Compliance = PdfCompliance.Pdf15; INotesCommentsLayoutingOptions options = pdfOptions.NotesCommentsLayouting; options.NotesPosition = NotesPositions.BottomFull; // Save the presentation to PDF with specified options pres.Save(dataDir + "Custom_Option_Pdf_Conversion_out.pdf", SaveFormat.Pdf, pdfOptions); } //ExEnd:CustomOptionsPDFConversion }
public static void Run() { //ExStart:ConvertSlidesToPdfNotes // The path to the documents directory. string dataDir = RunExamples.GetDataDir_Conversion(); // Instantiate a Presentation object that represents a presentation file Presentation presentation = new Presentation(dataDir + "SelectedSlides.pptx"); Presentation auxPresentation = new Presentation(); ISlide slide = presentation.Slides[0]; auxPresentation.Slides.InsertClone(0, slide); // Setting Slide Type and Size //auxPresentation.SlideSize.SetSize(presentation.SlideSize.Size.Width, presentation.SlideSize.Size.Height,SlideSizeScaleType.EnsureFit); auxPresentation.SlideSize.SetSize(612F, 792F, SlideSizeScaleType.EnsureFit); PdfOptions pdfOptions = new PdfOptions(); INotesCommentsLayoutingOptions options = pdfOptions.NotesCommentsLayouting; options.NotesPosition = NotesPositions.BottomFull; auxPresentation.Save(dataDir + "PDFnotes_out.pdf", SaveFormat.Pdf, pdfOptions); //ExEnd:ConvertSlidesToPdfNotes }
public static void Run() { //ExStart:PresentationToTIFFWithCustomImagePixelFormat // The path to the documents directory. string dataDir = RunExamples.GetDataDir_Conversion(); // Instantiate a Presentation object that represents a Presentation file using (Presentation presentation = new Presentation(dataDir + "DemoFile.pptx")) { TiffOptions options = new TiffOptions(); options.PixelFormat = ImagePixelFormat.Format8bppIndexed; INotesCommentsLayoutingOptions notesOptions = options.NotesCommentsLayouting; notesOptions.NotesPosition = NotesPositions.BottomFull; /* * ImagePixelFormat contains the following values (as could be seen from documentation): * Format1bppIndexed; // 1 bits per pixel, indexed. * Format4bppIndexed; // 4 bits per pixel, indexed. * Format8bppIndexed; // 8 bits per pixel, indexed. * Format24bppRgb; // 24 bits per pixel, RGB. * Format32bppArgb; // 32 bits per pixel, ARGB. */ // Save the presentation to TIFF with specified image size presentation.Save(dataDir + "Tiff_With_Custom_Image_Pixel_Format_out.tiff", SaveFormat.Tiff, options); } //ExEnd:PresentationToTIFFWithCustomImagePixelFormat }
public static void Run() { //ExStart:ConvertWithNoteToTiff // The path to the documents directory. string dataDir = RunExamples.GetDataDir_Conversion(); // Instantiate a Presentation object that represents a presentation file using (Presentation pres = new Presentation(dataDir + "ConvertWithNoteToTiff.pptx")) { TiffOptions opts = new TiffOptions(); INotesCommentsLayoutingOptions notesOptions = opts.NotesCommentsLayouting; notesOptions.NotesPosition = NotesPositions.BottomFull; // Saving the presentation to TIFF notes pres.Save(dataDir + "TestNotes_out.tiff", SaveFormat.Tiff, opts); } //ExEnd:ConvertWithNoteToTiff }
public static void Run() { //ExStart:RenderingNotesWhileConvertingToHTML // The path to the documents directory. string dataDir = RunExamples.GetDataDir_Conversion(); using (Presentation pres = new Presentation(dataDir + "Presentation.pptx")) { HtmlOptions opt = new HtmlOptions(); INotesCommentsLayoutingOptions options = opt.NotesCommentsLayouting; options.NotesPosition = NotesPositions.BottomFull; // Saving notes pages pres.Save(dataDir + "Output.html", SaveFormat.Html, opt); } //ExEnd:RenderingNotesWhileConvertingToHTML }
public static void Run() { //ExStart:ConvertNotesSlideViewToPDF // The path to the documents directory. string dataDir = RunExamples.GetDataDir_Conversion(); // Instantiate a Presentation object that represents a presentation file using (Presentation presentation = new Presentation(dataDir + "NotesFile.pptx")) { PdfOptions pdfOptions = new PdfOptions(); INotesCommentsLayoutingOptions options = pdfOptions.NotesCommentsLayouting; options.NotesPosition = NotesPositions.BottomFull; // Saving the presentation to PDF notes presentation.Save(dataDir + "Pdf_Notes_out.pdf", SaveFormat.Pdf, pdfOptions); } //ExEnd:ConvertNotesSlideViewToPDF }
public static void Run() { //ExStart:ConvertWholePresentationToHTML // The path to the documents directory. string dataDir = RunExamples.GetDataDir_Conversion(); // Instantiate a Presentation object that represents a presentation file using (Presentation presentation = new Presentation(dataDir + "Convert_HTML.pptx")) { HtmlOptions htmlOpt = new HtmlOptions(); htmlOpt.HtmlFormatter = HtmlFormatter.CreateDocumentFormatter("", false); INotesCommentsLayoutingOptions notesOptions = htmlOpt.NotesCommentsLayouting; notesOptions.NotesPosition = NotesPositions.BottomFull; // Saving the presentation to HTML presentation.Save(dataDir + "ConvertWholePresentationToHTML_out.html", SaveFormat.Html, htmlOpt); } //ExEnd:ConvertWholePresentationToHTML }
//ExStart:ConvertIndividualSlide public static void Run() { string dataDir = RunExamples.GetDataDir_Conversion(); using (Presentation presentation = new Presentation(dataDir + "Individual-Slide.pptx")) { HtmlOptions htmlOptions = new HtmlOptions(); htmlOptions.HtmlFormatter = HtmlFormatter.CreateCustomFormatter(new CustomFormattingController()); INotesCommentsLayoutingOptions notesOptions = htmlOptions.NotesCommentsLayouting; notesOptions.NotesPosition = NotesPositions.BottomFull; // Saving File for (int i = 0; i < presentation.Slides.Count; i++) { presentation.Save(dataDir + "Individual Slide" + (i + 1) + "_out.html", new[] { i + 1 }, SaveFormat.Html, htmlOptions); } } }
public static void Run() { //ExStart:ConvertWithCustomSize // The path to the documents directory. string dataDir = RunExamples.GetDataDir_Conversion(); // Instantiate a Presentation object that represents a Presentation file using (Presentation pres = new Presentation(dataDir + "Convert_Tiff_Custom.pptx")) { // Instantiate the TiffOptions class TiffOptions opts = new TiffOptions(); // Setting compression type opts.CompressionType = TiffCompressionTypes.Default; INotesCommentsLayoutingOptions notesOptions = opts.NotesCommentsLayouting; notesOptions.NotesPosition = NotesPositions.BottomFull; // Compression Types // Default - Specifies the default compression scheme (LZW). // None - Specifies no compression. // CCITT3 // CCITT4 // LZW // RLE // Depth depends on the compression type and cannot be set manually. // Resolution unit is always equal to “2” (dots per inch) // Setting image DPI opts.DpiX = 200; opts.DpiY = 100; // Set Image Size opts.ImageSize = new Size(1728, 1078); // Save the presentation to TIFF with specified image size pres.Save(dataDir + "TiffWithCustomSize_out.tiff", SaveFormat.Tiff, opts); } //ExEnd:ConvertWithCustomSize }
public static void Run() { //ExStart:ConvetToSWF // The path to the documents directory. string dataDir = RunExamples.GetDataDir_Conversion(); // Instantiate a Presentation object that represents a presentation file using (Presentation presentation = new Presentation(dataDir + "HelloWorld.pptx")) { SwfOptions swfOptions = new SwfOptions(); swfOptions.ViewerIncluded = false; INotesCommentsLayoutingOptions notesOptions = swfOptions.NotesCommentsLayouting; notesOptions.NotesPosition = NotesPositions.BottomFull; // Saving presentation and notes pages presentation.Save(dataDir + "SaveAsSwf_out.swf", SaveFormat.Swf, swfOptions); swfOptions.ViewerIncluded = true; presentation.Save(dataDir + "SaveNotes_out.swf", SaveFormat.Swf, swfOptions); } //ExEnd:ConvetToSWF }