翻譯|使用教程|編輯:李顯亮|2021-08-16 10:30:00.297|閱讀 294 次
概述:PowerPoint中的TIFF轉(zhuǎn)換可以在各種情況下,如打印,傳真等有用的,以便以編程方式執(zhí)行此轉(zhuǎn)換,本文將介紹如何使用C#PowerPoint演示PPTX / PPT轉(zhuǎn)換成TIFF。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
PowerPoint中的TIFF轉(zhuǎn)換可以在各種情況下,如打印,傳真等有用的,以便以編程方式執(zhí)行此轉(zhuǎn)換,本文將介紹如何使用C#PowerPoint演示PPTX / PPT轉(zhuǎn)換成TIFF。此外,您將學(xué)習(xí)如何自定義生成的 TIFF 圖像的大小和像素格式。
為了轉(zhuǎn)換 PowerPoint 演示文稿,我們將使用Aspose.Slides for .NET,它旨在從 .NET 應(yīng)用程序中創(chuàng)建、操作和轉(zhuǎn)換演示文檔。
>>你可以點(diǎn)擊這里下載Aspose.Slides 最新版測試體驗。
以下是使用 C# 將 PowerPoint PPTX/PPT 轉(zhuǎn)換為 TIFF 的步驟。
以下代碼示例顯示了如何將 PowerPoint PPTX 文件轉(zhuǎn)換為 TIFF。
// Instantiate a Presentation object that represents a presentation file using (Presentation presentation = new Presentation("Presentation.pptx")) { // Saving the presentation to TIFF document presentation.Save("output.tiff", SaveFormat.Tiff); }
Aspose.Slides for .NET 還允許您自定義 PowerPoint 到 TIFF 轉(zhuǎn)換中生成的圖像的大小。以下是實現(xiàn)此目的的步驟。
下面的代碼示例演示如何PPTX格式轉(zhuǎn)換為TIFF與自定義圖像大小。
// Instantiate a Presentation object that represents a Presentation file using (Presentation pres = new Presentation("Presentation.pptx")) { // Instantiate the TiffOptions class TiffOptions opts = new TiffOptions(); // Setting compression type opts.CompressionType = TiffCompressionTypes.Default; // 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("TiffWithCustomSize_out.tiff", SaveFormat.Tiff, opts); }
以下是使用C#定制在PPTX像素格式的步驟TIFF轉(zhuǎn)換。
以下代碼示例展示了如何在 PPTX 到 TIFF 轉(zhuǎn)換中自定義像素格式。
// Instantiate a Presentation object that represents a Presentation file using (Presentation presentation = new Presentation("Presentation.pptx")) { TiffOptions options = new TiffOptions(); options.PixelFormat = ImagePixelFormat.Format8bppIndexed; /* 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("Tiff_With_Custom_Image_Pixel_Format_out.tiff", SaveFormat.Tiff, options); }
如果你想試用Aspose的全部完整功能,可聯(lián)系在線客服獲取30天臨時授權(quán)體驗。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn