MCP cover image
See in Github
2024-05-03

MCPDF是带有固定Unicode问题的PDFTK的替代方法,因此您可以将其写入您的表格中。

12

Github Watches

11

Github Forks

45

Github Stars

Mcpdf

Mcpdf is an alternative to PDFtk with fixed unicode issues, so you can write Łódź into your forms.

It implements a small subset of PDFtk for which it implements compatible command line interface, so it can be used as a drop-in replacement for this subset of commands.

Internally it uses the iText PDF library.

Getting Started

Make sure you have installed a Java Runtime Environment such as OpenJDK.

Download the latest standalone version of Mcpdf (jar-with-dependencies).

For the sake of brevity, we will refer to this file as mcpdf.jar. So you should either rename the file or create a symlink:

ln -s mcpdf-0.2.10-jar-with-dependencies.jar mcpdf.jar

Test it via:

java -jar mcpdf.jar

Usage

For the implemented subset of commands (see below), Mcpdf can be used as a drop-in replacement for PDFtk, taking a PDFtk command and replace pdftk with java -jar mcpdf.jar.

Please create an issue tracker entry if you would like to add more commands.

Fill in form data

Fill in form data from DATA.xfdf into FORM.pdf and write the result to OUTPUT.pdf:

java -jar mcpdf.jar FORM.pdf fill_form - output - < DATA.xfdf > OUTPUT.pdf

Fill in form data and flatten the document to prevent further editing:

java -jar mcpdf.jar FORM.pdf fill_form - output - flatten < DATA.xfdf > OUTPUT.pdf

Add stamp and/or background

Use BACKGROUND.pdf as a background for INPUT.pdf and output to OUTPUT.pdf:

java -jar mcpdf.jar INPUT.pdf background BACKGROUND.pdf output - > OUTPUT.pdf

Similarly, you can use the stamp functionality to add STAMP.pdf as a stamp (i.e. foreground) for INPUT.pdf and output into OUTPUT.pdf. This works just like background, except that it places STAMP.pdf in front of INPUT.pdf instead of behind it:

java -jar mcpdf.jar INPUT.pdf stamp STAMP.pdf output - > OUTPUT.pdf

Advanced Topics

Combine with Another Library Version

Download the plain JAR file (mcpdf-0.2.10.jar) instead of the jar-with-dependencies.

Download the version of the iText PDF library you want to use (itextpdf-X.Y.Z.jar).

Run both in combination:

java -cp itextpdf-X.Y.Z.jar:mcpdf-0.2.10.jar aero.m_click.mcpdf.Main

Build from Source

Make sure you have installed Maven and Git.

Download the latest Mcpdf source and change into that folder:

git clone https://github.com/m-click/mcpdf.git
cd mcpdf

Build the plain JAR file as well as the jar-with-dependencies:

mvn package

This will download the correct version of the iText PDF library and all required Maven modules automatically.

You will find the JAR files in the target subfolder.

Deploy Releases

Mcpdf uses the Sonatype OSSRH (OSS Repository Hosting Service). The project creation ticket was OSSRH-8759.

Create ~/.m2/settings.xml:

<settings>
  <servers>
    <server>
      <id>sonatype-nexus-snapshots</id>
      <username>...</username>
      <password>...</password>
    </server>
    <server>
      <id>sonatype-nexus-staging</id>
      <username>...</username>
      <password>...</password>
    </server>
  </servers>
</settings>

Prepare documentation:

VERSION=`sed -n 's/^  <version>\([^-]*\).*/\1/p' pom.xml`
sed -i "s,mcpdf\([-/]\)[0-9.]*[0-9],mcpdf\1$VERSION,g" README.md
git commit -m "Prepare documentation for release mcpdf-$VERSION" README.md

Create a new release and upload it to the OSSRH staging area:

mvn release:clean release:prepare release:perform && git push

In case this fails with an error message stating that javadoc cannot be found, try setting JAVA_HOME:

export JAVA_HOME=/usr && mvn release:clean release:prepare release:perform && git push

If the automatic deployment failed:

  • Open https://oss.sonatype.org/
    • Select Staging Repositories
    • Click Refresh a few times as needed
    • If it failed to be closed automatically, click Close, then Confirm
    • Click Refresh a few times as needed
    • If it failed to be released automatically, click Release, then Confirm

Watch it appear at the Central Repository:

License

Affero GPL v3

Copyright (C) 2014 Volker Grabsch grabsch@m-click.aero

相关推荐

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • n8n-io
  • 具有本机AI功能的公平代码工作流程自动化平台。将视觉构建与自定义代码,自宿主或云相结合,400+集成。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • metorial
  • 数百个MCP服务器的容器化版本📡📡

  • langgenius
  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

    Reviews

    1 (1)
    Avatar
    user_5LFENR1B
    2025-04-17

    As a dedicated user of mcp applications, I must say that mcpdf is a fantastic tool! Developed by m-click and available at https://github.com/m-click/mcpdf, this utility has significantly streamlined my PDF handling tasks. Its user-friendly interface and robust functionality make it a must-have for anyone dealing with PDF documents regularly. Highly recommended!