1 Star 4 Fork 1

jeffatoptics / mpe-pdf-template

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Markdown templates for PDF page in MPE

Purpose

PDF Header Footer Generation with MPE

The project presents the markdown templates for MPE (Markdown Preview Enhanced) extension to generate PDF pages with header, footer and page break via with Chrome (puppeteer). The settings are demonstrated in the front matter of markdown file.

Editor and extension are listed as following:

Usage

  1. clone or copy the .md files to the local folder

  2. use or change the front matter settings in md file.

  3. if you want to generate header with a different logo,

    • use a tool to convert the logo image to a base64 string
    • replace this string in the template with logos.

:memo: Template with Logo header : avoid messy format

  • The long base64 string make the file looks messy. The solution is to use two files.

    • input the content in another file, e.g. document_content.md

    • define the header, footer and title in header file

    • use "@import" in the header file to import the content.

Files

  1. simple_header_footer.md template with title in header, and page number in footer.

  2. complex_header_footer.md: template with title/version in header, date/copyright/page number in footer

  3. vscLogo_header_footer.md: adds the VS code logo.

  4. document_content.md separate file for the content input, used with the logo templates

Reference

This project is inspired by the following projects and issue discussions.

  1. Github: tmori3y2's project: mpe-puppeteer-header-footer-example

  2. Github: Headers/Footers on PDF! · Issue #1028

MIT License Copyright (c) 2022 jeffatoptics Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

markdown templates for generating pdf pages header footer and page break with MPE vscode extensions 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jeffatoptics/mpe-pdf-template.git
git@gitee.com:jeffatoptics/mpe-pdf-template.git
jeffatoptics
mpe-pdf-template
mpe-pdf-template
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891