Convert Figma logo to code with AI

mrmn2 logoPdfDing

Selfhosted PDF manager, viewer and editor offering a seamless user experience on multiple devices.

1,586
84
1,586
14

Top Related Projects

52,603

PDF Reader in JavaScript

10,820

Display PDFs in your React app as easily as if they were images.

12,193

Client/server side PDF printing in pure JavaScript

10,554

A JavaScript PDF generation library for Node and the browser

Quick Overview

PdfDing is a Python library for manipulating PDF files. It provides a simple interface for common PDF operations such as merging, splitting, and extracting pages. The library is designed to be easy to use and efficient for handling large PDF files.

Pros

  • Simple and intuitive API for PDF manipulation
  • Efficient handling of large PDF files
  • Supports a wide range of PDF operations
  • Pure Python implementation with minimal dependencies

Cons

  • Limited documentation and examples
  • May lack some advanced PDF features
  • Not actively maintained (last update was over a year ago)
  • Limited community support and contributions

Code Examples

Merging multiple PDF files:

from pdfding import PdfDing

pdf = PdfDing()
pdf.merge(['file1.pdf', 'file2.pdf', 'file3.pdf'], 'merged.pdf')

Extracting specific pages from a PDF:

from pdfding import PdfDing

pdf = PdfDing()
pdf.extract('input.pdf', 'output.pdf', pages=[1, 3, 5])

Splitting a PDF into multiple files:

from pdfding import PdfDing

pdf = PdfDing()
pdf.split('input.pdf', 'output_prefix', pages_per_file=2)

Getting Started

To get started with PdfDing, follow these steps:

  1. Install the library using pip:

    pip install pdfding
    
  2. Import the PdfDing class in your Python script:

    from pdfding import PdfDing
    
  3. Create a PdfDing instance and use its methods to manipulate PDF files:

    pdf = PdfDing()
    pdf.merge(['input1.pdf', 'input2.pdf'], 'output.pdf')
    

That's it! You can now use PdfDing to perform various PDF operations in your Python projects.

Competitor Comparisons

52,603

PDF Reader in JavaScript

Pros of pdf.js

  • Widely adopted and battle-tested in production environments
  • Extensive documentation and community support
  • Supports a broader range of PDF features and rendering capabilities

Cons of pdf.js

  • Larger file size and potentially higher resource usage
  • More complex codebase, which may be challenging for beginners
  • Might be overkill for simple PDF viewing needs

Code Comparison

PdfDing (Python):

def render_page(self, page_number):
    page = self.pdf.pages[page_number]
    image = page.render()
    return image

pdf.js (JavaScript):

pdfjsLib.getDocument(url).promise.then(function(pdf) {
  pdf.getPage(pageNumber).then(function(page) {
    var scale = 1.5;
    var viewport = page.getViewport({ scale: scale });
    // Render page content
  });
});

PdfDing is a simpler Python-based PDF viewer, while pdf.js is a more comprehensive JavaScript-based PDF renderer. PdfDing may be easier to integrate into Python projects, but pdf.js offers more features and wider browser compatibility. The code comparison shows that PdfDing has a more straightforward approach to rendering pages, while pdf.js provides more flexibility and control over the rendering process.

10,820

Display PDFs in your React app as easily as if they were images.

Pros of react-pdf

  • Built specifically for React applications, offering seamless integration
  • Provides a more comprehensive set of features for PDF rendering and manipulation
  • Actively maintained with frequent updates and a larger community

Cons of react-pdf

  • Larger package size due to its extensive feature set
  • May have a steeper learning curve for developers new to React

Code Comparison

react-pdf:

import { Document, Page } from 'react-pdf';

function MyApp() {
  return (
    <Document file="sample.pdf">
      <Page pageNumber={1} />
    </Document>
  );
}

PdfDing:

from pdfding import PdfDing

pdf = PdfDing("sample.pdf")
pdf.render_page(1)

Additional Considerations

  • PdfDing is a Python-based library, making it more suitable for server-side processing or non-React applications
  • react-pdf offers more flexibility in terms of client-side rendering and interactivity
  • PdfDing may be easier to set up and use for simple PDF processing tasks
  • react-pdf provides better support for responsive design and mobile-friendly PDF viewing

Both libraries have their strengths, and the choice between them largely depends on the specific requirements of your project and the technology stack you're using.

12,193

Client/server side PDF printing in pure JavaScript

Pros of pdfmake

  • More comprehensive documentation and examples
  • Supports client-side PDF generation in browsers
  • Larger community and more frequent updates

Cons of pdfmake

  • Larger file size and potentially slower performance
  • More complex setup for simple use cases
  • Limited support for existing PDF manipulation

Code Comparison

PdfDing:

from pdfding import PdfDing

pdf = PdfDing("input.pdf")
pdf.add_text("Hello, World!", x=100, y=100)
pdf.save("output.pdf")

pdfmake:

var docDefinition = {
  content: [
    { text: 'Hello, World!', absolutePosition: { x: 100, y: 100 } }
  ]
};
pdfMake.createPdf(docDefinition).download('output.pdf');

PdfDing is a Python library focused on simple PDF manipulation, while pdfmake is a JavaScript library for creating PDFs from scratch. PdfDing offers straightforward methods for adding content to existing PDFs, whereas pdfmake provides a more flexible document definition approach for generating PDFs from the ground up. The choice between the two depends on the specific use case and development environment.

10,554

A JavaScript PDF generation library for Node and the browser

Pros of PDFKit

  • More mature and widely used project with extensive documentation
  • Supports a broader range of PDF creation features and customization options
  • Active development and regular updates

Cons of PDFKit

  • Larger file size and potentially more complex setup
  • May have a steeper learning curve for beginners

Code Comparison

PDFKit:

const PDFDocument = require('pdfkit');
const doc = new PDFDocument();
doc.pipe(fs.createWriteStream('output.pdf'));
doc.text('Hello, world!');
doc.end();

PdfDing:

from pdfding import PdfDing
pdf = PdfDing()
pdf.add_text("Hello, world!")
pdf.save("output.pdf")

Additional Notes

PDFKit is a JavaScript library for creating PDF documents, while PdfDing is a Python library. PDFKit offers more advanced features and flexibility, making it suitable for complex PDF generation tasks. PdfDing, on the other hand, provides a simpler API and may be easier to use for basic PDF creation needs.

The choice between these libraries depends on the specific requirements of your project, the programming language you prefer, and the level of complexity needed in PDF generation.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

PdfDing

Selfhosted PDF manager, viewer and editor offering a seamless user experience on multiple devices.

Website  â€¢  Demo  â€¢  Docs  â€¢  Get Started


GitHub Repo Stars Docker Pulls Version GitHub Actions Workflow Status Last Commit

PdfDing Demo Screenshot

Introduction

PdfDing is a PDF manager, viewer and editor that you can host yourself. It offers a seamless user experience on multiple devices. It's designed be to be minimal, fast, and easy to set up using Docker.

The name is a combination of PDF and ding. Ding is the German word for thing. Thus, PdfDing is a thing for your PDFs. Initially inspired by linkding.

A live demo, powered by PikaPods, is available at demo.pdfding.com.

Features

  • Seamless browser based PDF viewing on multiple devices. Remembers current position - continue where you stopped reading
  • Stay on top of your PDF collection with workspaces, collections, multi-level tagging, starring and archiving functionalities
  • Edit PDFs by adding text, highlighting and drawings
  • Add signatures to PDFs and access them on all devices
  • Manage and export PDF highlights and comments in dedicated sections
  • Clean, intuitive UI with dark mode, inverted color mode, custom theme colors and multiple layouts
  • SSO support via OIDC
  • Share PDFs with an external audience via a link or a QR Code with optional access control
  • Markdown Notes
  • Progress bars show the reading progress of each PDF at a quick glance

Getting started

Ready to dive into PdfDing? Then head over to the Getting Started pages of the documentation and find instructions for setting up PdfDing via Docker, Docker Compose and Helm. Configuration options can be found here.

Sponsor

PdfDing is an open source project and its code & container images are provided for free, without any strings attached. However, developing and maintaining PdfDing requires a lot of time. By sponsoring you allow me to spend more time on PdfDing and make it even better.

Sponsorship Details • GitHub Sponsors • KoFi

Contributing

Small improvements, bugfixes and documentation improvements are always welcome. If you want to contribute a larger feature, consider opening an issue first to discuss it. I may choose to ignore PRs for features that don't align with the project's goals or that I don't want to maintain.

If you are interested in contributing more information can be found in the Contributing pages of the docs. There are also ways to contribute if you are not a developer.

Website, Docs & Blog

The repository, which contains the source code for the project website and the documentation, can be found on Codeberg.

Acknowledgements

This project was funded through the NGI0 Commons Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101135429.

NLnet foundation logo     NGI Zero Logo