著科技的飛速發展,數字創作已經成為了一種流行的創作方式。如今,越來越多的人選擇將紙質畫冊轉化為翻頁電子版畫冊,以便更好地展示和傳播自己的作品。你也想掌握這項技能,但卻苦于不知從何入手?接下來教你制作翻頁電子版畫冊的攻略,讓你輕松掌握數字創作技巧。
首先,讓我們來看一個具體的案例。假設你有一份精美的PDF文件,你想將它轉化為可翻頁的畫冊,以便讓更多的人欣賞到你的作品。根據數據統計,電子版畫冊的受眾范圍比紙質畫冊更廣泛,傳播速度也更快。那么,如何將這本插畫集轉化為翻頁電子版畫冊呢?
第一步,選擇合適的制作軟件。目前市面上有許多可供選擇的軟件,如FLBOOK在線制作電子雜志平臺。這個平臺都具有豐富的功能和簡潔的界面,可以幫助你輕松完成畫冊的制作。
第二步,導入PDF文件。點擊開始創作,將PDF文件導入到這個平臺上,可支持單文件上傳和多文件上傳。
第三步,添加翻頁效果。為了讓電子版畫冊更具趣味性,你可以為作品添加翻頁效果。在FLBOOK中,你可以通過添加翻頁動畫來實現這一效果。翻頁動畫有多種類型,如平滑翻頁、漸變翻頁等。你可以根據自己的喜好選擇合適的翻頁動畫。
第四步,導出電子版畫冊。在完成所有設置后,你可以將畫冊導出為電子版。FLBOOK支持多種輸出格式,如PDF、EXE、HTML等。你可以根據需要選擇合適的輸出格式。
通過以上五個步驟,你就可以將一本紙質畫冊成功轉化為翻頁電子版畫冊。掌握了這項技能,你將能夠在數字創作的道路上越走越遠?,F在,就讓我們一起開啟數字創作之旅吧!
明
已知一份excel文件
OleView.exe 查看excel支持的接口
只支持在windows機器上運行
方案
具體思路就是將excel文件打開,然后使用“另存為”功能,將其轉換為html文檔。需要用到 win32com 模塊提供的功能,使用的是win com 接口編程。不需要熟悉COM,只需要知道操作的技術。
1、找到使用的接口
使用OleView可以查看當前系統所有組件支持的COM接口。
A、打開OleView,并選中Type Libraries
B、找到 Excel,并雙擊打開,復制右側文本到其他編輯器查找需要的函數
C、比如查找的 SaveAs接口
2、使用Python操作
import win32com.client
import os
if__name__=='__main__':
excel=win32com.client.Dispatch('Excel.Application')
file_name="2017-12-18.xlsx"
file_name=os.path.abspath(file_name)
workbook=excel.Workbooks.Open(file_name)
workbook.SaveAs(Filename="test.html",FileFormat=win32com.client.constants.xlHtml)
workbook.Close()
excel.Quit()
It’s quick and simple to convert HTML to PDF with Prince. HTML is seamlessly transformed into documents you can print
下載地址
Prince - Download Prince
系統名稱 | x86_64 | arm64 | 說明 |
Windows | 有 | - | |
Red Hat Enterprise Linux 7-9 | 有 | - | |
Ubuntu 18-22 | 有 | 有 | |
Debian GNU Linux 9-10 | 有 | - | |
Debian GNU Linux 11-12 | 有 | 有 | |
OpenSUSE | 有 | - | |
MacOS | ? | ? | |
Alpine Linux | 有 | - | |
Generic Linux | 有 | 有 | |
Free BSD | 有 | - |
<dependency>
<groupId>com.princexml</groupId>
<artifactId>prince-java-wrapper</artifactId>
<version>1.3.0</version>
</dependency>
// 獲取 java 版本
String version = System.getProperty("java.specification.version");
// 獲取系統類型
String platform = System.getProperty("os.name", "");
platform = platform.toLowerCase().contains("window") ? "win" : "linux";
// 當前程序目錄
String current = System.getProperty("user.dir");
System.out.println(String.format("current=%s", current));
// html 文件路徑
File index = Paths.get(current, "..", "index.html").toFile();
if (!index.exists()) {
System.out.println(String.format("file not exist,file=%s", index.getAbsolutePath()));
return;
}
String command = Paths.get(current, "..", "prince-15.2-win64", "bin", "prince.exe").toString();
if (OSInfo.getOSType() == OSInfo.OSType.LINUX) {
command = "prince";
}
Prince prince = new Prince(command);
// prince.setLog("/path/to/log.txt");
// prince.addStyleSheet("/path/to/stylesheet.css");
// prince.addScript("/path/to/script.js");
prince.setJavaScript(true);
try {
// 轉換 html 文件
File file = Paths.get(current, String.format("java%s_%s.pdf", version, platform)).toFile();
prince.convert(index.getAbsolutePath(), file.getAbsolutePath());
} catch (IOException e) {
e.printStackTrace();
}
prince-demo/java1.8_win.pdf · yjihrp/linux-html2pdf-demo - Gitee.com
prince-demo/java11_linux.pdf · yjihrp/linux-html2pdf-demo - Gitee.com
下一篇 2-LINUX HTML 轉 PDF-itext5、8
*請認真填寫需求信息,我們會在24小時內與您取得聯系。