Linearize PDFs in processing

Aperta
#504 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

The processing steps live under documentcloud/documents/processing/info_and_image, which the issue links as the place where PDFs are handled. Read that code to find where the PDF is written after processing, then check how pikepdf's Pdf.save is called there. Done means processed PDFs are saved in linearized form, with a test or manual check that the output is linearized. Whether the S3 bucket needs configuration for range requests is still open and should be settled first.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

processing

This would help loading large PDFs, building on this work in the viewer:

The one performance benefit of rendering PDF pages as images—instead of downloading the PDF and rendering it with PDF.js—is that very large files can be incrementally downloaded and rendered. In the majority of cases, downloading and rendering the PDF is faster and more performant than rendering an image for each page.

It appears to me that PDF.js supports partial rendering of linearized PDFs by default. In this demo, we can see in the network tab how each page is being independently fetched and rendered with 206 Partial Content responses. Linearizing a PDF requires additional steps during PDF creation (in Acrobat, there's a separate checkbox for "Fast Web View," which is a user-friendly name for linearization).

In a quick examination of DocumentCloud's processing pipeline, it doesn't appear to me that we perform linearization as a step in the process. While QPDF and pikepdf both support linearization, it's an opt-in feature that's disabled by default. It's unclear whether we need any special configuration to the S3 bucket to support partial requests, or if HTTP Range Requests are supported by default.

Lingua principale
Python
Stelle
55
Fork
10
Merge medio
1g 13h
PR unite (30g)
22

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di MuckRock/documentcloud

Tutte le issue di MuckRock/documentcloud

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.