Convert Figma logo to code with AI

mrmn2 logoPdfDing

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

1,013
49
1,013
14

Top Related Projects

51,137

PDF Reader in JavaScript

10,257

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

12,012

Client/server side PDF printing in pure JavaScript

10,283

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

51,137

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,257

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,012

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,283

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

PdfDing is a selfhosted PDF manager, viewer and editor offering a seamless user experience on multiple devices.

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

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.

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 multi-level tagging, starring and archiving functionalities
  • Edit PDFs by adding comments, highlighting and drawings
  • 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

Using Docker

To install PdfDing using Docker you can just run the image from Docker Hub:

docker run --name pdfding \
    -p 8000:8000 \
    -v sqlite_data:/home/nonroot/pdfding/db -v media:/home/nonroot/pdfding/media \
    -e HOST_NAME=127.0.0.1 -e SECRET_KEY=some_secret -e CSRF_COOKIE_SECURE=FALSE -e SESSION_COOKIE_SECURE=FALSE \
    -d \
    mrmn/pdfding:latest

If everything completed successfully, the application should now be running and can be accessed at http://127.0.0.1:8000.

If you use selinux it might be necessary to add the :Z after the volumes, e.g. sqlite_data:/home/nonroot/pdfding/db:Z.

Using Docker Compose

To install PdfDing using Docker Compose, you can use one of the files in the compose directory and run e.g.:

docker-compose -d -f compose/sqlite.docker-compose.yaml

Using Helm

PdfDing can be deployed on Kubernetes using the provided helm chart. To add the PdfDing helm repository, run:

helm repo add pdfding https://charts.pdfding.com

To install the PdfDing helm chart with a release name my-release in ns namespace, run:

helm install -n ns --create-namespace my-release pdfding/pdfding

Sponsor

I hope you enjoy using PdfDing as much as I enjoy developing it. If you want to give back, you can support me on various platforms. This allows me to spend more time on improving PdfDing. Thanks!

gh sponsor   buy me a coffee   ko-fi

Guides

Guides about various aspects of PdfDing can be found in the guides section of the docs.

Configuration

Information about the different configuration options can be found in the configuration section of the docs.

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 development section of the docs.

Comparison with Stirling PDF

While Stirling PDF and PdfDing are both self-hosted web applications centered around PDF files, they still differ in their use case. Stirling PDF focuses on performing various operations like splitting, cropping and rotating on your PDFs. PdfDing however has a different focus, it is all about reading and organizing your PDFs. All features are added with the goal of improving the reading experience or making the management of your PDF collection simpler. PdfDing's editing functionalities were added with the same idea in mind. You can add annotations, highlighting and drawings to PDFs, so that you can highlight or add information that will be beneficial to your reading experience.