PDF Patcher
Thank you for your attention to PDF Patch. Please read this description and the license agreement before using the software or source code. This software and source code adopt the AGPL + " Conscience License " agreement - every time the user benefits from using this software, he should do a good deed; if he uses the source code to develop new software and obtains profits, he should use the proceeds as non-profit. Donate less than one thousandth to the disadvantaged groups in society .
Function introduction
PDF Patch is a PDF processing tool. It has the following features:
- Modify PDF documents: modify document properties, page numbers, and page links; unify page sizes; delete actions such as automatically opening web pages; remove copy and print restrictions; set the reader initial mode; clean documents to hide junk data; recompress black and white images; rotate pages .
- Intimate PDF bookmark editor: It has a reading interface (with a right-to-left reading method that is convenient for reading vertical documents), and can modify PDF bookmark properties (color, style, target page number, zoom ratio, etc.) in batches, and bookmarks can be accurately positioned to In the middle of the page; perform search and replace in bookmarks (supports regular expressions and XPath matching, can quickly select chapter, chapter, and section bookmarks), and automatically and quickly generates document bookmarks.
- Create PDF files: merge existing PDF files or pictures to generate new PDF files; the merged PDF document has the bookmarks of the original document, and new bookmarks can also be attached (or generated based on the file name). The text and style of the new bookmark can be Customizable; merged PDF documents can be assigned a uniform page size for printing and reading.
- Split or merge PDF files and keep the bookmarks of the original files or add new ones.
- Export images of PDF documents at high speed and losslessly.
- Convert PDF pages to images.
- Extract or delete specified pages from the PDF document, and adjust the page order of the PDF document.
- Rename PDF file names based on PDF document metadata.
- Call the image recognition engine of Microsoft Office to analyze the text in the PDF document image; convert the table of contents page of the image PDF into a PDF bookmark. The recognition results can be written to PDF files.
- Replace fonts: Replace the fonts used in the document; embed fonts into PDF documents to eliminate garbled characters when copying text, making it readable on devices without fonts (such as e-book readers such as Kindle).
- Analyze document structure: Display the PDF document structure in a tree view, edit and modify PDF document nodes, or export PDF documents into XML files for analysis and debugging by PDF enthusiasts.
- Free forever, never expires, no ads, no pop-up nonsense dialog boxes, no privacy prying.
License Agreement
The "PDF Patch" software (hereinafter referred to as the software) is protected by copyright laws, international treaty provisions and other intellectual property laws and treaties. This software is free to end users. Since this software uses third-party open source components with AGPL terms, the usage agreement for this software and its source code is also based on AGPL. There are also the following additional conditions. Under the premise of complying with this software, you can freely use and distribute it on the basis of complying with this agreement. Once you install, copy or use this software, it means that you have agreed to the terms of this agreement. If you do not agree to this agreement, please do not install or use this software, nor should you use its source code.
Additional conditions: Every user who uses this software, if this software helps you, you should do one good deed after each use of this software. No matter how big or small a good deed is, just do it if you have the heart to do it. For example:
- If your parents are around, you can cook a delicious meal for them, or give them a massage or wash their feet; if they are far away, you can make a call to them and ask about their health and life.
- When it rains heavily, if you have an umbrella, you can share it with others on the road; when the sun is shining brightly, if you see sanitation workers working under the sun, you can buy them a bottle of water and give it to them; On public transportation or while waiting in line in a public place, if you have a seat, you can offer it to the elderly, pregnant women, or people carrying heavy objects.
- You can use your skills to help people around you solve their problems; you can share your knowledge with others so that they can benefit; you can donate money and gifts to people who are in more difficulty than you.
- If you think this software is really useful, please introduce its use to others so that others can benefit from using this software; or introduce other software that you think is useful to others.
If you are unable to do one good deed after using this software, please keep it in mind. When you have the opportunity, do more good deeds and accumulate virtue. Whether you comply with this User Agreement or not depends entirely on your conscience. It is for “ authorization of conscience .”
Related definitions:
- Software: Software refers to the "PDF Patch" software and its updates, product manuals, online documents and other related carriers.
- Restrictions: You can use the source code of this software to develop applications (free, shared or commercial), and you can also distribute an unlimited number of complete copies of this software in any way, but the premise is: ① You must provide the software when you distribute the software Full version, no modifications to the software or its installation program are allowed without permission; ② You cannot change this license agreement when distributing the software; ③ If you add this software to commercial promotion activities or products, you should obtain a written consent from the copyright owner. Permission; ④ If you use the source code of this software to write other software and generate sales revenue, you should donate no less than one thousandth of the sales revenue of the software to disadvantaged groups in society.
- Support: The software will be continuously updated due to user needs, and the copyright holder will provide various related information support including user manuals, emails, etc., but the software does not guarantee that the supported content and functions will not change.
- Termination: When you do not agree or violate this agreement, the agreement will be automatically terminated and you must delete this software product immediately.
- Copyright: This software and source code are protected by copyright laws, international treaty provisions and other intellectual property laws and treaties.
- Disclaimer: This software and the copyright owner are not responsible for any losses caused by the installation, copying, and use of this software.
Introduction to commonly used PDF open source components
The specification for PDF documents (ISO 32000-1:2008 "Document management — Portable document format — Part 1: PDF 1.7") can be found online and is generally a must-read for PDF processing program developers.
The PDF document format involves a number of technologies in the printing field, has its own unique document structure, and uses a variety of data compression algorithms. It is usually difficult and unrealistic for ordinary people to write a PDF document processing program from scratch. PDF Patch is developed using the .NET Framework and mainly uses iText and MuPDF, two open source component libraries, to process PDF documents.
The former is a .NET component that has good interoperability with the PDF main program, and is superior to the latter in terms of parsing, generating and modifying PDF documents, and embedding TTF font subsets.
The latter is developed and compiled in C language. Compared with the former, its biggest advantage is the function of rendering PDF documents into bitmaps. The dynamic component library compiled by MuPDF can be downloaded from SharpMuPDF, another open source code library of the author. PDF Patch calls the function of this component library through P/Invoke technology.
In addition to PDF open source components, the program also uses other excellent open source components. For example, ObjectListView is a powerful list control, FreeImage is used to read and decode various types of bitmap image files, Cyotek's ImageBox is used to display rendered PDF document pages, TabControlExtra is used to build a tabbed document interface, and HTMLRenderer is used to display HTML web interface and more.
Source code structure
- App Catalog: PDF Patch Main Program
- Common: some commonly used tool classes
- Functions: Forms and controls used to present various functions of the software
- Lib: third-party components used by the program
- Model: the high-level model used when editing documents (the basic data model is implemented by the classes of iText and MuPDF)
- Options: program options
- Processor: Algorithm for processing PDF documents (the P/Invoke class that calls MuPDF is placed in the Mupdf directory)
- doc directory: Place the usage documentation of the program
- JBig2 directory: Places the encoding and decoding library code for JBIG2 images
Operating environment
- Operating system Windows 7 or above.
- .NET Framework versions 4.0 to 4.8.
- To use the text recognition function, you need to install the Document Imaging component (MODI) of Microsoft Office 2003 (or 2007).
- To compile the program source code, it is recommended to use Visual Studio 2019 or newer, and install the two workloads ".NET Desktop Development" (used to compile PDF patch source code) and "C++ Desktop Development" (used to compile JBIG2 coding components) . If you use Visual Studio 2022, you may encounter the problem that the project "targets the .NET Framework that is no longer supported" and needs to "update the target to .NET Framework 4.8". The simple method is to update the target to .NET Framework 4.8. If you do not want to update the target, please refer to the method introduced in this article.
Contact the author
Except for third-party components, the source code of this software is completely open:
https://github.com/wmjordan/PDFPatcher
https://gitee.com/wmjordan/pdfpatcher
It is recommended to submit your suggestions or needs by submitting an issue through the open source website. Due to busy daily work, we do not provide QQ or WeChat consultation services for the time being. Please understand.
In the email or message, please indicate your version number, attach screenshots and attachments, and detail the problem you encountered.
If you need to provide an attachment, please make it smaller. Under normal circumstances, it is best not to send attachments larger than 10M.
- For PDF files, the "Extract Pages" function can be used to extract representative pages.
- For image files, please compress the source file, or provide a representative image of one or two pages.