资源简介
该项目中包含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文档转换为图片的方法(该方法基于第三方DLL),你可以像这样调用该方法:
/// ConvertPDF2Image(“F:\\PdfFile.doc“ “F:\\“ “ImageFile“ 1 20 ImageFormat.Png 256);
///
/// Word文件路径
/// 图片输出路径,如果为空,默认值为Word所在路径
/// 图片的名字,不需要带扩展名,如果为空,默认值为Word的名称
/// 从PDF文档的第几页开始转换,如果为0,默认值为1
/// 从PDF文档的第几页开始停止转换,如果为0,默认值为Word总页数
/// 设置所需图片格式,如果为null,默认格式为PNG
/// 设置图片的像素,数字越大越清晰,如果为0,默认值为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
相关资源
- Office 2007 六组件 转PDF 加载项 SaveAsP
- ASP生成Word或Excel或RTF或PDF或图片
- Aspose.Words 18.7 带SkiaSharp 解决了错误
- Aspose.Words 18.7破解版本,含.net core版本
- aspose-words-15.8.0最新完美破解版无水印
- ast2500v14.pdf
-
me
tasploit渗透测试指南(完整版) - .Net Core使用AsposeWord转PDF
- How to build AutoML from scratch – Alexander
- Aspose.Words导出到word
- Aspose(Word 18.7Cell 18.4) for .Net 破解版
- Learning Linux Binary Analysis [2016,完美P
- Advances in Financial Machine Learning-Wiley(
- Advances in Financial Machine Learning-Wiley(
- OpenSceneGraph 3 Cookbook pdf
- Aspose.word.dll文件,修复The document app
- Computer Security: Art and Science 计算机安
- Aspose.Words.dll最新破解版,完美去水印
- aspose excel工具-无限license
- aspose-words-18.5版本2018年4月18日发布版
- Aspose.Words.18.11.0--破解版
- aspose.words 18.7破解版18年7月最新版本
- aspose-words-18.6-jdk16破解版
- 《射频通信电路》陈邦媛 PDF
-
aspose-word+license.xm
l - Aspose.Words 19.11.net core 可用
- Introduction to Algorithms 3rd 原版pdf by C
- mysql crash course (英文版 pdf)
- ast2500V17.pdf
- GRASP10[1].3.0培训教程(公开).pdf
评论
共有 条评论