android ppt转html,ppt转html格式

1.1ppt转html

1.1.1ppt转pdf

通过libreoffice工具转换成pdf

这个在windows实现 下载好就行   跟平常的软件一个用法

图片没上传上去抱歉、、

打开

保存到你要保存的目录

1.1.2pdf转html

参见githubhttps://github.com/coolwanglu/pdf2htmlEX/wiki/Download

从Docker容器运行是将pdf文件转换为html的最简单的方法,您不需要知道如何编译和安装pdf2htmlEX。

因为pdf2htmlEX 安装太麻烦了依赖太多

1.1.2.1安装docker

系统centos6.8yum install -y docker-io

/etc/init.d/docker start

1.1.2.2如何使用这个docker容器把pdf文件转换成html

假设你有一个PDF文件/ pdf / test.pdf,只需运行docker run -ti --rm -v ~/pdf:/pdf bwits/pdf2htmlexpdf2htmlEX --zoom 1.3 test.pdf

将test.html在~/pdf目录中生成一个HTML文件。

首次执行会从仓库拉一个镜像下来等待时间较长[root@lanyezi ~]# docker p_w_picpaths

REPOSITORY         TAG                 IMAGE ID            CREATED             VIRTUAL SIZE

bwits/pdf2htmlex   latest             bacf7f15f6e6        23 monthsago       245.6 MB

1.1.2.3运行docker容器作为本地命令

设置一个软连接。。docker运行容器然后执行对应的命令alias pdf2htmlEX='docker run -ti --rm -v `pwd`:/pdfbwits/pdf2htmlex pdf2htmlEX'

pdf2htmlEX -h

pdf2htmlEX --zoom 1.3 test.pdf

有关如何运行pdf2htmlEX的详细信息,请阅读维基https://github.com/coolwanglu/pdf2htmlEX/wiki/Quick-Start

1.1.3关于如何运行pdf2htmlEX

1.1.3.1第一件事先

强烈建议您安装ttfautohint并随时添加--external-hint-tool=ttfautohint以下每个配方。此工具可以增强Windows上所有浏览器的字体渲染。

仔细检查您是否poppler-data安装了CJK字符。

仔细检查你已经运行sudo make install,或者pdf2htmlEX可能无法正确执行

最简单的情况

假设你有一个PDF文件pdf/test.pdf,只需运行

pdf2htmlEX命令是上文通过docker做的软连接容器pdf2htmlEX --zoom 1.3 pdf/test.pdf

将test.html在当前目录中生成一个HTML文件。

1.1.3.2高级pdf2htmlEX -f 3 -l 5 --fit-width 1024 --bg-formatjpg pdf/test.pdf

将仅转换第3,4页和第页,并将页宽调整为1024像素。背景图像将以JPEG格式生成。

1.1.3.3对于发布商pdf2htmlEX --embed cfijo --dest-dir outpdf/test.pdf

将test.html在out目录中产生一个和附带的文件,以这种方式将所有资源(字体,图像,CSS和JavaScript)存储在分离的文件中,以便查看器可以更好地利用浏览器缓存。

1.1.3.4适用于高级发布商pdf2htmlEX --embed cfijo --split-pages 1 --dest-dirout --page-filename test-%d.page pdf/test.pdf

将执行类似的操作,但每个单独的页面都存储在一个单独的文件中。命令行中指定的文件名称等test-0.page,test-1.page依此类推。仍然有一个test.html通过ajax动态加载页面。以这种方式,发布商被完全控制,谁可以按照他们喜欢的方式组织页面,例如实现延迟页面加载。

1.1.3.5终极之手pdf2htmlEX --fallback 1 pdf/test.pdf

也会产生一个单一的test.html,然而,它包括图像和隐藏的文本。这种模式提供最大的精度和兼容性,代价是更大的文件大小。仅当pdf2htmlEX无法正确处理您的文件时,才能使用此模式。

自发研究pdf2htmlEX --fallback  1  --fit-width 1024 --fit-height 720  --bg-format jpg test.pdf

1.1.3.6更多

只要记住man pdf2htmlEX,pdf2htmlEX --help永远是你最好的朋友。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
namespace PPT2Img { class Program { [STAThread] static void Main(string[] args) { TaskTimerRecorder taskTimerRecorder = new TaskTimerRecorder(); //确认需要执行的操作 //getinfo:获取总页数 //convert:将指定起始页码换到指定文件夹 string strActionMode = "getinfo"; //拿到输入文件名 string strPPTFileName = "PPT路径"; //拿到输出图片路径 string strOutputFilePath = "图片输出路径"; //拿到输出图片的名词前缀(后缀就是从0计数的页码) string strPrefix = "输出图片前缀"; //需要抠掉的颜色 uint nColor = 0xffffffff; //需要输出的起始页码 int nBeginPage = 0; //需要输出的结束页码(-1为全部输出) int nEndPage = -1; //宽高 int nWidth = 1920; int nHeight = 1080; if (args.Length > 0) { strActionMode = args[0]; if (args.Length > 1) { strPPTFileName = args[1]; } if (args.Length > 2) { strOutputFilePath = args[2]; if (strActionMode == "getinfo") { Console.WriteLine("工作模式是:" + strActionMode); Console.WriteLine("PPT路径是:" + strPPTFileName); Console.WriteLine("结果输出路径是:" + strOutputFilePath); Console.WriteLine("开始执行"); ESBasic.Office.OfficeScanner scaner = new ESBasic.Office.OfficeScanner(); int nPage = scaner.GetInfo(strPPTFileName); FileStream fs = File.Create(strOutputFilePath + "pagecount.txt"); StreamWriter sw = new StreamWriter(fs); sw.WriteLine(nPage.ToString()); sw.Close(); fs.Close(); Console.WriteLine("执行结束"); return; } else if (strActionMode == "convert") { if (args.Length > 3) { strPrefix = args[3]; if (args.Length > 4) { string strColor = args[4]; nColor = uint.Parse(strColor, System.Globalization.NumberStyles.HexNumber); if (args.Length > 5) { string strBeginPage = args[5]; nBeginPage = int.Parse(strBeginPage); if (args.Length > 6) { string strEndPage = args[6]; nEndPage = int.Parse(strEndPage); if (args.Length > 7) { string strWidth = args[7]; nWidth = int.Parse(strWidth); if (args.Length > 8) { string strHeight = args[8]; nHeight = int.Parse(strHeight); //Console.WriteLine("1:工作模式是:" + strActionMode); //Console.WriteLine("2:PPT路径是:" + strPPTFileName); //Console.WriteLine("3:图片输出路径是:" + strOutputFilePath); //Console.WriteLine("4:图片输出前缀是:" + strPrefix); //Console.WriteLine("5:需要抠掉的颜色是:" + nColor.ToString()); //Console.WriteLine("6:输出起始页码是:" + nBeginPage.ToString()); //Console.WriteLine("7:输出结束页码是:" + nEndPage.ToString()); //Console.WriteLine("8:输出宽度是" + nWidth.ToString()); //Console.WriteLine("9:输出高度是" + nHeight.ToString()); //Console.WriteLine("1:" + strActionMode); //Console.WriteLine("2:" + strPPTFileName); //Console.WriteLine("3:" + strOutputFilePath); //Console.WriteLine("4:" + strPrefix); //Console.WriteLine("5:" + nColor.ToString()); //Console.WriteLine("6:" + nBeginPage.ToString()); //Console.WriteLine("7:" + nEndPage.ToString()); //Console.WriteLine("8:" + nWidth.ToString()); //Console.WriteLine("9:" + nHeight.ToString()); ESBasic.Office.OfficeScanner scaner = new ESBasic.Office.OfficeScanner(); int nPage = scaner.Convert(strPPTFileName, strOutputFilePath, strPrefix, nColor, nBeginPage, nEndPage, nWidth, nHeight); FileStream fs = File.Create(strOutputFilePath + "pagecount.txt"); StreamWriter sw = new StreamWriter(fs); sw.WriteLine(nPage.ToString()); sw.Close(); fs.Close(); return; } } } } } } Console.WriteLine("1:" + strActionMode); Console.WriteLine("2:" + strPPTFileName); Console.WriteLine("3:" + strOutputFilePath); Console.WriteLine("4:" + strPrefix); Console.WriteLine("5:" + nColor.ToString()); Console.WriteLine("6:" + nBeginPage.ToString()); Console.WriteLine("7:" + nEndPage.ToString()); Console.WriteLine("8:" + nEndPage.ToString()); Console.WriteLine("9:" + nEndPage.ToString()); Console.WriteLine("10"); } } } else { #if false //无参数模式,给一些参数,调试使用 strActionMode = "convert"; strPPTFileName = "C:\\Users\\dujiangtao\\Desktop\\测试2.pptx"; strOutputFilePath = "E:\\output\\"; strPrefix = "ppt"; nColor = 0x000000ff; nWidth = 1920; nHeight = 1080; nColor = uint.Parse("000000ff", System.Globalization.NumberStyles.HexNumber); nBeginPage = 0; nEndPage = -1; ESBasic.Office.OfficeScanner scaner = new ESBasic.Office.OfficeScanner(); int nPage = scaner.Convert(strPPTFileName, strOutputFilePath, strPrefix, nColor, nBeginPage, nEndPage, nWidth, nHeight); FileStream fs = File.Create(strOutputFilePath + "pagecount.txt"); StreamWriter sw = new StreamWriter(fs); sw.WriteLine(nPage.ToString()); sw.Close(); fs.Close(); taskTimerRecorder.Stop(); Console.ReadLine(); #endif } } } }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值