Passa al contenuto principale

Estrai pagine da PDF In n8n

Estrai pagine da PDF è un PDF4me azione del nodo in n8n che costruisce un nuovo PDF contenente solo il pages che elenchi. Usalo per estrarre una pagina di firme da un contratto, isolare un singolo capitolo da un manuale o passare ai passaggi successivi solo il riepilogo pages invece dell'intero documento.

Cosa fa questo nodo

PDF4me: Estrai pagine da PDF prende un PDF da Binary Data, un Base64 String, o un URL e restituisce un nuovo file contenente solo il pages denominato in Numeri di paginaQuel campo è l'intera azione: accetta singoli pages, intervalli con trattini, elenchi misti e intervalli aperti che si estendono fino alla fine del documento. Poiché viene eseguito come fase del flusso di lavoro, la stessa regola di estrazione si applica a ogni file che arriva senza che nessuno apra un editor.

Articoli correlati del blog
Non ci sono ancora post sul blog dedicati a questa funzionalità — in arrivo a breve.
Nel frattempo, dai un'occhiata al blog di PDF4me per trovare tutorial e procedure operative su tutte le piattaforme.
Visita il blog

Autenticazione del tuo API Richiesta

Ogni PDF4me nodo in n8n richiede un valido Credenziali per connettersi con. Crea o selezionane uno che contenga il tuo PDF4me API chiave affinché il flusso di lavoro possa autenticare in modo sicuro le richieste di estrazione.

Informazioni importanti da non perdere

Il campo "Numeri di pagina" è l'unico che conta.
È richiesto e convalidato. Lascialo vuoto e n8n contrassegna il campo prima che il nodo venga eseguito.
Gli intervalli aperti gestiscono un numero variabile di pagine
Scrivere 10- significa da pagina 10 fino alla fine, quindi un'unica impostazione funziona per documenti di lunghezza diversa.
Le pagine sono numerate da 1
La prima pagina è la numero 1, non la numero 0. Presta attenzione a questo aspetto quando un nodo di codice precedente genera programmaticamente l'elenco delle pagine.
Il nodo PDF4me in n8n è impostato su Azione Estrai pagine da PDF, Tipo di dati di input Dati binari, Campo binario di input dati, Nome documento output.pdf, un campo Numeri di pagina obbligatorio vuoto e Nome campo binario di output dati

PDF4me Estrai pagine da PDF pannello dei parametri in n8n

Pagine estraibili vs. pagine divise PDF

Entrambi producono documenti più piccoli, ma rispondono a domande diverse. L'estrazione chiede quale pages vuoi conservare; la divisione chiede come dovrebbe essere suddiviso l'intero documento.

DomandaEstrai pagine da PDFDiviso PDF
How many files come backOne PDF holding the pages you listedSeveral PDFs covering the whole document
What happens to unlisted pagesThey are absent from the outputThey still appear, in another output file
Typical usePull the signature page, one chapter, or a summary sectionBreak a bundle into per-invoice or per-section files
Driven byAn explicit page list you supplyA split rule such as page count, text, or barcode

Quali parametri estrae le pagine da PDF Bisogno?

Necessario: Azione, Tipo di dati di input, il campo corrispondente a quel tipo di input, Nome del documento e Numeri di pagina. Il nome del campo binario di output ha un valore predefinito di lavoro datie la sezione Opzioni avanzate è inizialmente vuota.

ParametroNecessarioCosa faEsempio
ActionRequiredSelects the PDF4me node action to run. Choose Extract Pages From PDF.Extract Pages From PDF
Input Data TypeRequiredFormat of the source PDF input. Choose Binary Data (from a previous node), Base64 String, or URL.Binary Data
Input Binary FieldConditionalName of the binary property on the incoming n8n item that holds the PDF. Required when Input Data Type is Binary Data. Defaults to data.data
Base64 Document ContentConditionalBase64-encoded content of the source PDF. Required when Input Data Type is Base64 String.JVBERi0xLjQK...
File URLConditionalPublicly reachable HTTPS URL to the source PDF. Required when Input Data Type is URL.https://example.com/report.pdf
Document NameRequiredFilename used for the document on the request, for reference and tracking. Include the .pdf extension.output.pdf
Page NumbersRequiredThe pages to keep. Accepts a comma-separated list, a hyphenated range, a mixed list, or an open range that runs to the end of the document. Pages are numbered from 1.1,3,5-8
Output Binary Field NameOptionalName of the binary property the output item exposes. Defaults to data.data
Advanced OptionsOptionalA collection that starts empty, shown as No properties with an Add Option button. Leave it alone unless you have a specific option to add.No properties

Come compilare il campo dei numeri di pagina

ModelloEsempioCosa ritorna
Single page5Just page 5, as a one page PDF.
Comma-separated list1,3,5Pages 1, 3, and 5 in one PDF, with pages 2 and 4 absent.
Hyphenated range2-5Pages 2, 3, 4, and 5, with both ends included.
Mixed list1,3,5-8Page 1, page 3, then the block from 5 to 8.
Open range10-Page 10 through the last page, whatever the document length turns out to be.

Campi di output

Una corsa di successo restituisce uno n8n oggetto che trasporta l'estratto PDF.

CampoTipoCosa contiene
Binary (data)BinaryThe extracted PDF, under Output Binary Field Name (default data).
fileNameStringGenerated filename of the extracted PDF.
mimeTypeStringMIME type of the output, always application/pdf.
fileSizeNumberSize of the returned PDF in bytes.
pagesExtractedNumberHow many pages ended up in the output. Compare it against the length of your requested list as a cheap sanity check.
originalPageCountNumberPage count of the source document before extraction.
extractedPageNumbersArrayThe page numbers that were actually extracted, useful for verifying the result against what you asked for.
successBooleanTrue when the extraction completed, false on failure. Use it to branch error handling.
messageStringHuman-readable status message, carrying success confirmation or error detail.

Come impostare l'estrazione delle pagine da PDF In n8n?

  1. Aggiungere PDF4me al tuo n8n flusso di lavoro e scegliere il Estrai pagine da PDF azione.
  2. In Credenziali per connettersi con, seleziona il tuo PDF4me credenziali o clicca Crea nuove credenziali e incolla il tuo API chiave.
  3. Impostato Tipo di dati di input A Dati binari (predefinito), Base64 String, O URL e fornire la fonte corrispondente PDF campo.
  4. Impostato Nome reale per il file sorgente, incluso il .pdf estensione.
  5. Inserisci Numeri di pagina utilizzando un elenco, un intervallo, un elenco misto o un intervallo aperto.
  6. Partire Nome del campo binario di output COME data a meno che un nodo successivo non si aspetti una proprietà diversa.
  7. Esegui il nodo e instrada il risultato PDF al passaggio successivo, come l'archiviazione, l'invio tramite e-mail o l'inserimento in una coda di revisione.

Configurazioni tipiche

Esempi di flusso di lavoroCommon n8n workflow patterns using Extract Pages From PDF.
Estrai la pagina delle firme da un contratto
  1. Il contratto firmato viene inviato come allegato e-mail.
  2. Estrai pagine da PDF prende l'ultima pagina utilizzando un intervallo aperto.
  3. La singola pagina viene archiviata nella scheda del cliente per una rapida consultazione.
Inviare ai revisori solo il riassunto
  1. Secondo una pianificazione prestabilita, viene generato un report dettagliato.
  2. Estrai pagine da PDF mantiene i primi pochi pages con una gamma come 1-3.
  3. I revisori ricevono il riassunto, mentre il rapporto completo viene archiviato.
Estrarre un capitolo da un manuale
  1. Una richiesta di assistenza fa riferimento a una sezione del manuale del prodotto.
  2. Estrai pagine da PDF tira fuori quel capitolo con un intervallo con trattino.
  3. Il cliente ottiene il pertinente pages invece di un accessorio di grandi dimensioni.
Estrarre e unire in un digest
  1. Diversi documenti originali contengono ciascuno una pagina che vale la pena conservare.
  2. Estrai pagine da PDF esegue ogni documento per estrarre quella pagina.
  3. Unione multipla PDFs combina i risultati in un unico compendio.

Consigli pratici

Use an open range for variable documents
When the page count differs between files, 10- keeps everything from page 10 onward without knowing the total.
Check pagesExtracted against your request
Comparing the returned count with the number of pages you asked for catches a malformed page list before it reaches the customer.
Remember pages start at 1
A code node that builds the list from a zero-based array will be off by one on every document. Add one when generating the string.
Extract before you merge
Pulling the wanted pages from each source first keeps the merge step small and the final document free of filler.
Branch on the success field
Test the returned success boolean before sending the file onward so a failed extraction raises an alert instead of forwarding an empty result.
Reuse one source for several subsets
The original is untouched, so the same PDF can feed two extraction nodes to produce an internal copy and a customer copy in one run.

Foglio riassuntivo

CampoValore
ActionExtract Pages From PDF
Input Data TypeBinary Data
Input Binary Fielddata
Document Nameoutput.pdf
Page Numbers1,3,5-8
Output Binary Field Namedata
Advanced OptionsNo properties
CredentialsPDF4me API credential

Domande frequenti

How do I write the Page Numbers field to extract a range?+
Page Numbers accepts four shapes. A comma-separated list such as 1,3,5 pulls individual pages. A hyphenated range such as 2-5 pulls everything between and including those pages. A mixed list such as 1,3,5-8 combines both. An open range such as 10- runs from page 10 to the end of the document, which is useful when the page count varies between files.
Is extracting pages the same as splitting a PDF?+
No. Extract Pages From PDF returns one new PDF containing only the pages you listed, and the pages you did not list are simply absent. Splitting divides a document into multiple output files covering the whole document. Choose extraction when you want a specific subset, and choose Split PDF when you want every page distributed across several files.
Does extracting pages change the original PDF?+
No. The node reads the source PDF you supply and returns a new file. The original document is untouched, so the same source can be run through several extractions in one workflow to produce different subsets.
What happens if I ask for a page number that does not exist?+
Page Numbers is a required field and is validated when the node runs. Requesting a page beyond the end of the document is an error case rather than a silent skip, so branch on the returned success field before passing the result downstream, especially when the page list is built dynamically from earlier workflow data.
Are the page numbers counted from one or from zero?+
Page numbers start at 1, matching what a reader sees in a PDF viewer. The first page of the document is 1, not 0. This matters most when the page list is generated by an earlier node in n8n code, where zero-based indexing is a common source of off-by-one output.

Azioni correlate

Stessa attività su altre piattaforme

Richiedi assistenza