91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

該項目中包含Aspose.words破解版DLL,以及微軟官方的office的插件,測試項目代碼。

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Drawing.Imaging;
using?Aspose.Words;
using?System.IO;
using?Aspose.Words.Saving;

namespace?Aspose.Word2Image
{
????class?Program
????{
????????///?
????????///?將Word文檔轉(zhuǎn)換為圖片的方法(該方法基于第三方DLL),你可以像這樣調(diào)用該方法:
????????///?ConvertPDF2Image(“F:\\PdfFile.doc“?“F:\\“?“ImageFile“?1?20?ImageFormat.Png?256);
????????///?

????????///?Word文件路徑
????????///?圖片輸出路徑,如果為空,默認(rèn)值為Word所在路徑
????????///?圖片的名字,不需要帶擴(kuò)展名,如果為空,默認(rèn)值為Word的名稱
????????///?從PDF文檔的第幾頁開始轉(zhuǎn)換,如果為0,默認(rèn)值為1
????????///?從PDF文檔的第幾頁開始停止轉(zhuǎn)換,如果為0,默認(rèn)值為Word總頁數(shù)
????????///?設(shè)置所需圖片格式,如果為null,默認(rèn)格式為PNG
????????///?設(shè)置圖片的像素,數(shù)字越大越清晰,如果為0,默認(rèn)值為128,建議最大值不要超過1024
????????public?static?void?ConvertWordToImage(string?wordInputPath?string?imageOutputPath
????????????string?imageName?int?startPageNum?int?endPageNum?ImageFormat?imageFormat?float?resolution)
????????{
????????????try
????????????{
????????????????//?open?word?file
????????????????Aspose.Words.Document?doc?=?new?Aspose.Words.Document(wordInputPath);

????????????????//?validate?parameter
????????????????if?(doc?==?null)?{?throw?new?Exception(“Word文件無效或者Word文件被加密!“);?}
????????????????if?(imageOutputPath.Trim().Length?==?0)?{?imageOutputPath?=?Path.GetDirectoryName(wordInputPath);?}
????????????????if?(!Directory.Exists(imageOutputPath))?{?Directory.CreateDirectory(imageOutputPath);?}
????????????????if?(imageName.Trim().Length?==?0)?{?imageName?=?Path.GetFileNameWithoutExtension(wordInputPath);?}
????????????????if?(startPageNum?<=?0)?{?startPageNum?=?1;?}
????????????????if?(endPageNum?>?doc.PageCount?||?endPageNum?<=?0)?{?endPageNum?=?doc.PageCount;?}
????????????????if?(startPageNum?>?endPageNum)?{?int?tempPageNum?=?startPageNum;?startPageNum?=?endPageNum;?endPageNum?=?startPageNum;?}
????????????????if?(imageFormat?==?null)?{?imageFormat?=?ImageFormat.Png;?}
????????????????if?(resolution?<=?0)?{?resolution?=?128;?}

????????????????ImageSaveOptions?imageSaveOptions?=?new?ImageSaveOptions(GetSaveFormat(imageFormat));
????????????????imageSaveOptions.Resolution?=?resolution;

????????????????//?start?to?convert?each?page
????????????????for?(int?i?=?startPageNum;?i?<=?endPageNum;?i++)
????????????????{
????????????????????imageSaveOptions.PageIndex?=?i?-?1;
????????????????????doc.Save(Path.Combine(imageOutputPath?imageName)?+?“_“?+?i.ToString()?+?“.“?+?imageFormat.ToString()?imageSaveOptions);
????????????????}
????????????}
????????????catch?(Exception?ex)
????????????{
????????????????throw?ex;
????????????}
????????}

????????private?static?SaveFormat?GetSaveFormat(ImageFormat?imageFormat)
????????{
????????????SaveFormat?sf?=?SaveFormat.

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-02-22?19:07??WORD2IMAGE\
?????目錄???????????0??2012-02-22?19:06??WORD2IMAGE\Aspose.word2image\
?????文件????????2856??2012-02-22?19:03??WORD2IMAGE\Aspose.word2image\Aspose.word2image.csproj
?????文件????????4021??2012-02-22?19:05??WORD2IMAGE\Aspose.word2image\Program.cs
?????目錄???????????0??2012-02-22?11:28??WORD2IMAGE\Aspose.word2image\Properties\
?????文件????????1378??2012-02-22?11:28??WORD2IMAGE\Aspose.word2image\Properties\AssemblyInfo.cs
?????目錄???????????0??2012-02-22?19:11??WORD2IMAGE\Microsoft.word2pdf\
?????文件????????2636??2012-02-22?19:09??WORD2IMAGE\Microsoft.word2pdf\Microsoft.word2pdf.csproj
?????文件????????4826??2012-02-22?19:09??WORD2IMAGE\Microsoft.word2pdf\Program.cs
?????目錄???????????0??2012-02-22?19:07??WORD2IMAGE\Microsoft.word2pdf\Properties\
?????文件????????1380??2012-02-22?19:07??WORD2IMAGE\Microsoft.word2pdf\Properties\AssemblyInfo.cs
?????文件????????1449??2012-02-22?19:08??WORD2IMAGE\WORD2IMAGE.sln
?????文件???????13312??2012-02-22?19:10??WORD2IMAGE\WORD2IMAGE.suo
?????目錄???????????0??2012-02-22?19:11??WORD2IMAGE\_dll\
?????文件?????6597120??2011-10-12?12:49??WORD2IMAGE\_dll\Aspose.Words.dll
?????文件??????781104??2007-10-10?09:49??WORD2IMAGE\_dll\Microsoft.Office.Interop.Word.dll
?????目錄???????????0??2012-02-22?19:11??WORD2IMAGE\_reference\
?????文件??????955112??2012-02-19?20:01??WORD2IMAGE\_reference\SaveAsPDFandXPS.exe

評論

共有 條評論