ChatGPT PDF生成指南:让文档创建成为一种愉快的体验

释放双眼,带上耳机,听听看~!
本文介绍了使用ChatGPT将Markdown文本转化为专业PDF文档的方法,让文档创建成为一种愉快的体验。

ChatGPT PDF生成指南:让文档创建成为一种愉快的体验

当我们复制 ChatGPT 的回答时,得到的是一个 Markdown 格式的文本。它使得 ChatGPT 仅仅通过一些符号就可以表现标题,列表,加粗和斜体等格式。尽管 Markdown 简洁而轻量,但并非适合很多专业场景,比如商业报告,办公文件,学术论文,简历等等。

那么我们如何让 ChatGPT 根据我们的需求,帮我们设计字体、颜色、布局,并生成 PDF 文件呢?本文将介绍三种方法,无论你用的是 ChatGPT 3.5 还是有插件功能的 ChatGPT 4,总有一种适合你。

使用 ChatGPT 3.5

ChatGPT 3.5 是无法直接生成 PDF 文件的,因此我们需要先让 ChatGPT 用 CSS 代码渲染成 HTML ,也就是网页,然后再用工具转化为 PDF 。

我写了这样一个 Prompt:

您是一名前端专家,擅长将 Markdown 转换成 HTML 并应用 CSS 转换成 PDF。以下是此过程中的分步说明。

  1. 粘贴 Markdown 代码
    • 操作: 提示用户粘贴 Markdown 代码,然后将其转换为 HTML。
    • 注意: Markdown 代码本身不会显示,但会进入第 2 步和第 3 步。
  2. 选择样式
    • 操作: 收到 Markdown 代码后,向用户提供五个样式选项,每个选项都会有简要说明。样式应增强 HTML 的视觉吸引力,并与内容或上下文保持一致。
  3. 接收样式化的 HTML 代码
    • 操作: 用户选择样式后,将相应的 CSS 应用于 HTML,创建样式化版本。
    • 重要: 提供整个 HTML 转换,而不仅仅是一个片段。

请严格按照说明顺序操作,不要遗漏或合并任何步骤。现在,让我们开始第 1 步。

You are a front-end specialist skilled in transforming Markdown into HTML and applying CSS for conversion into a PDF. Below, you will find step-by-step instructions to follow in this process.

  1. Paste the Markdown Code:
    • Action: Prompt the user to paste the Markdown code, which you will then convert into HTML.
    • Note: The Markdown code itself won’t be displayed but will proceed to step 2 and Step 3.
  2. Choose a Style:
    • Action: After receiving the Markdown code, present the user with five style options, each described briefly. The styles should enhance the visual appeal of the HTML and align with the content or context.
  3. Receive Stylized HTML Code:
    • Action: Once the user selects a style, apply the corresponding CSS to the HTML, creating a stylized version.
    • Important: Provide the entire HTML conversion, not just a snippet.

Please adhere to the instructions in the exact order provided, without omitting or amalgamating any steps. Now, let’s proceed with Step 1.

推荐大家使用英文的版本,效果会更好。输入 Prompt 以后,ChatGPT 就会按顺序执行我在 Prompt 里说明的步骤。首先,它会让我粘贴 Markdown 代码。

ChatGPT PDF生成指南:让文档创建成为一种愉快的体验

比如我要粘贴的 Markdown如下:

# Exploring the Mysteries of Markdown

*Unraveling the secrets of* **Markdown** can be a fascinating journey. Let's embark on this adventure with a mix of text formatting and other elements.

## Lists and Code

In our quest, we'll encounter both ordered and unordered lists:

1. Begin by researching Markdown basics.
2. Explore the depths of Markdown syntax.
3. Dive into advanced formatting techniques.

- Don't forget to escape special characters: `*italic*`, `**bold**`.

## Links and Images

Along the way, we'll find helpful resources:

- Read the [Markdown Guide](https://www.markdownguide.org) to master Markdown.
- <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/1280px-Markdown-mark.svg.png" alt="Markdown Logo" style="zoom:25%;" />

## Blockquotes and Tables

Reflecting on our journey, we remember this quote:

> "To code in Markdown is to paint with words." - Anonymous

Here's a table to organize our findings:

| Element     | Purpose                           |
| ----------- | --------------------------------- |
| Headers     | Organize content hierarchy        |
| Emphasis    | Add *emphasis* and **strength**   |
| Code        | Highlight `code` snippets       |
| Lists       | Enumerate and itemize information |
| Links       | Connect to external resources     |
| Images      | Visualize concepts                |
| Blockquotes | Highlight important thoughts      |
| Tables      | Display data neatly               |

---

*Markdown* enables us to express ideas with elegance and simplicity. As we conclude our exploration, we realize that it's not just a markup language; it's a canvas where words become art.

*[Click here](https://www.example.com) to delve even deeper.*

粘贴给 ChatGPT 以后,它就进行了第2步,根据 Markdown 的内容给我提供了5种风格让我选择,我选择了 “Creative Colorful”。

感谢您提供 Markdown 代码。现在让我们进入第 2 步:选择样式

请从以下样式选项中选择一种,以增强 HTML 转换的视觉效果:

  1. 经典优雅
  2. 现代简约
  3. 自然灵感
  4. 创意多彩
  5. 专业单色

做出选择后,我将进入第 3 步,根据您选择的风格为您提供样式化的 HTML 代码。

ChatGPT PDF生成指南:让文档创建成为一种愉快的体验

然后 ChatGPT 就完成了第3步,生成了内置 CSS 的 HTML 代码。

ChatGPT PDF生成指南:让文档创建成为一种愉快的体验

把 HTML 代码复制到记事本,然后把后缀名从 .txt 变成 .html 就把 Markdown 格式变为了一个网页。然后再用在线工具,比如 cloudconvert 就把 Markdown 变成了 PDF 文件,效果如下:
ChatGPT PDF生成指南:让文档创建成为一种愉快的体验

ChatGPT PDF生成指南:让文档创建成为一种愉快的体验

使用 ChatGPT 插件

上面的方法也适用于 ChatGPT 4,但是使用代码解释器的话有点问题。

👉 1分钟处理1000个文档:ChatGPT代码解释器就是这么牛

代码解释器的沙盒环境缺少一些用来转换 Markdown 的库,比如 Pandoc。从 HTML 转换到 PDF 的效果也并不理想。但是 ChatGPT Plus 用户可以使用插件来实现转换,比如 A+ Doc Maker。

下面我以这个插件为例,如果不知道如何激活插件,可以看我往期的文章:

👉 如何解锁ChatGPT插件

激活了插件以后,只需要告诉 ChatGPT 你要把 Markdown 转化为 PDF 就好了。当然,要把 Markdown 粘贴到 Prompt 里。提交了 Prompt 以后,ChatGPT 的回复里会包含一个链接。

ChatGPT PDF生成指南:让文档创建成为一种愉快的体验

点击 ChatGPT 回复中的链接就可以进入 A+ Docker 的网站。

ChatGPT PDF生成指南:让文档创建成为一种愉快的体验

网页主要分为三部分,左边是可选择的 PDF 的主题,中间是 Markdown 编辑器,右边是 PDF 预览。在左边的主题选项里选一个你最喜欢的主题,然后点击最上方的 “DOWNLOAD PDF” 就可以下载 PDF 了。如果成为这个网站的付费会员,还可以选择更漂亮的主题。

Typora

Typora 是一个非常好用的 Markdown 编辑器,我每天都在用,价格是一次性的15美金。

它有各种好看的主题可以使用。

ChatGPT PDF生成指南:让文档创建成为一种愉快的体验

比如这个 Lapis 主题我就非常喜欢。

ChatGPT PDF生成指南:让文档创建成为一种愉快的体验

选择主题以后,在文件菜单里选择导出,然后选择导出为 PDF 就可以了。

ChatGPT PDF生成指南:让文档创建成为一种愉快的体验

总结

在数字时代,制作格式精美的 PDF 不一定是一项艰巨的任务。有了全能的 ChatGPT,任何人都可以将纯 Markdown 文本转化为专业 PDF 文档。无论你使用的是 ChatGPT 3.5、ChatGPT Plus 还是 Typora 等工具,这些方法都可以提升生产力和创造力。不妨探索这些技巧,让文档创建成为一种愉快的体验。

分享完毕,感谢阅读🤗 欢迎点赞,收藏,评论

更多免费原创教程,🚀关注公众号:我的AI力量

本网站的内容主要来自互联网上的各种资源,仅供参考和信息分享之用,不代表本网站拥有相关版权或知识产权。如您认为内容侵犯您的权益,请联系我们,我们将尽快采取行动,包括删除或更正。
AI教程

深度学习初体验:神经网络和框架

2023-11-18 20:44:14

AI教程

生成式AI:银行业未来智能化的关键

2023-11-18 20:54:14

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索