Pular para o conteúdo principal

Sobreposição PDFs em n8n

Sobreposição PDFs é um PDF4me ação do nó em n8n que coloca um PDF em cima de outra, combinando ambas no mesmo. pages Em vez de anexá-las, use-o para imprimir um cabeçalho personalizado sobre o conteúdo gerado, aplicar uma moldura de certificado ou sobrepor um modelo aprovado a um documento recebido sem adicionar uma única página.

O que este nó faz

PDF4me: Sobreposição PDFs leva dois PDFs, um base que serve de pano de fundo e um camada que fica por cima e retorna um único documento onde ambos aparecem no mesmo pagesCada arquivo possui seu próprio tipo de entrada, portanto, a base pode vir de um nó anterior como Dados Binários, enquanto a camada é extraída de um... URLAo contrário da mesclagem, o número de páginas não aumenta, o que a torna a ferramenta ideal para papéis timbrados, molduras e carimbos de modelo.

Artigos relacionados no blogue(1)

Autenticando seu API Solicitar

Todo PDF4me nó em n8n requer um válido Credencial para se conectar comCrie ou selecione um que contenha o seu PDF4me API chave para que o fluxo de trabalho possa autenticar solicitações de sobreposição com segurança.

Fatos importantes que você não deve perder

A sobreposição não está mesclada.
A junção de anexos pages Assim, a contagem se soma. A sobreposição empilha ambos os documentos no mesmo espaço. pages, deixando o número de páginas inalterado.
Dois arquivos, dois tipos de entrada independentes
Base PDF Tipo de entrada e camada PDF Os tipos de entrada são definidos separadamente, portanto, um arquivo pode conter dados binários enquanto o outro chega de um formato diferente. URL.
A ordem altera o que permanece visível.
A camada fica sobre a camada base. Uma camada com fundo sólido pode ocultar o conteúdo abaixo dela, portanto, teste ambas as ordens em um par de amostras primeiro.
O nó PDF4me no n8n está configurado para a ação "Sobrepor PDFs", com os tipos de entrada "Base PDF Input Type" e "Layer PDF Input Type" definidos como "Binary Data", os campos binários "Base PDF Field data", os campos binários "Layer PDF Field data", o nome do arquivo de saída "overlayed_output.pdf" e o nome da saída de dados binários.

PDF4me Sobreposição PDFs painel de parâmetros em n8n, com ambos os tipos de entrada definidos como Dados Binários

Sobreposição vs. Mesclagem vs. Marca d'água

Três maneiras de adicionar conteúdo extra a um PDF, cada um produzindo um documento diferente.

AbordagemEfeito sobre o pagesMelhor ajuste
Overlay PDFsBoth documents appear on the same pages, page count unchangedBranding that already exists as a designed PDF, such as a letterhead or certificate frame
Merge PDFsDocuments follow one another, page counts add upContent that genuinely belongs in sequence as one longer document
Add watermarkSimple text or a single image drawn onto the existing pagesA short notice such as DRAFT or CONFIDENTIAL, where no designed PDF layer exists

Quais parâmetros a sobreposição utiliza? PDFs Precisar?

Obrigatório: A ação, ambos os tipos de entrada, o campo de origem correspondente a cada tipo de entrada e o nome do arquivo de saída. O nome de saída de dados binários e qualquer item em Opções avançadas possuem valores padrão funcionais.

ParâmetroObrigatórioO que fazExemplo
ActionRequiredSelects the PDF4me node action to run. Choose Overlay PDFs.Overlay PDFs
Base PDF Input TypeRequiredFormat of the background PDF. Choose Binary Data, Base64 String, or URL. Independent of the layer setting.Binary Data
Layer PDF Input TypeRequiredFormat of the PDF placed on top. Choose Binary Data, Base64 String, or URL. Independent of the base setting.Binary Data
Base PDF Binary FieldConditionalName of the binary property holding the base PDF. Required when Base PDF Input Type is Binary Data.data
Layer PDF Binary FieldConditionalName of the binary property holding the layer PDF. Required when Layer PDF Input Type is Binary Data.data
Base PDF Base64 ContentConditionalBase64-encoded content of the base PDF. Required when Base PDF Input Type is Base64 String.JVBERi0xLjQK...
Layer PDF Base64 ContentConditionalBase64-encoded content of the layer PDF. Required when Layer PDF Input Type is Base64 String.JVBERi0xLjQK...
Base PDF File URLConditionalPublicly reachable HTTPS URL to the base PDF. Required when Base PDF Input Type is URL.https://example.com/base.pdf
Layer PDF File URLConditionalPublicly reachable HTTPS URL to the layer PDF. Required when Layer PDF Input Type is URL.https://example.com/letterhead.pdf
Output File NameRequiredFilename for the combined PDF. Include the .pdf extension.overlayed_output.pdf
Binary Data Output NameOptionalName of the binary property the output item exposes. Defaults to data.data
Advanced OptionsOptionalCollection for extra processing settings, added with Add Option. Leave empty unless you have a specific requirement.No properties

Campos de saída

Uma corrida bem-sucedida retorna um n8n item que carrega o combinado PDF.

CampoTipoO que contém
Binary (data)BinaryThe combined PDF with the layer placed over the base, under Binary Data Output Name (default data).
fileNameStringGenerated filename, matching Output File Name.
mimeTypeStringMIME type of the output, always application/pdf.
fileSizeNumberSize of the combined PDF in bytes.
docNameStringDocument name reference for the processed file, matching fileName.
overlayCompletedBooleanConfirms the overlay operation finished, useful as an explicit check that the layer was applied.
layersProcessedNumberCount of PDF layers combined into the final document.
successBooleanTrue when the operation completed, false on failure. Use it to branch error handling.
messageStringHuman-readable status message, carrying success confirmation or error detail.

Como configuro a sobreposição? PDFs em n8n?

  1. Adicionar PDF4me para o seu n8n fluxo de trabalho e escolha o Sobreposição PDFs Ação.
  2. Em Credencial para se conectar com, selecione o seu PDF4me credencial ou clique Criar nova credencial e cole o seu API chave.
  3. Definir Base PDF Tipo de entrada e Camada PDF Tipo de entradaEles são independentes, portanto cada arquivo pode chegar de forma diferente.
  4. Preencha os campos de origem correspondentes, por exemplo. Base PDF Campo Binário e Camada PDF Campo Binário, ambos com o valor padrão de data.
  5. Definir Nome do arquivo de saída (deve terminar em .pdf).
  6. Execute o nó e direcione o tráfego combinado. PDF, exposto sob Nome da saída de dados binários, para a próxima etapa.

Configurações típicas

Exemplos de fluxo de trabalhoCommon n8n workflow patterns using Overlay PDFs.
Papel timbrado em documentos gerados
  1. Um documento é gerado a partir de um modelo sem qualquer marca d'água.
  2. Sobreposição PDFs Aplica o cabeçalho aprovado. PDF retirado de um URL como a camada.
  3. O resultado final, com a marca, é enviado sem que um designer o tenha tocado.
Moldura de certificado sobre conteúdo dinâmico
  1. Os dados de conclusão do curso produzem um resultado simples. PDF com o nome do destinatário.
  2. Sobreposição PDFs Coloca a borda do certificado desenhada sobre ele.
  3. Cada certificado finalizado é enviado por e-mail ao destinatário.
Carimbo de aprovação nos documentos de revisão
  1. Um documento conclui uma etapa de aprovação no fluxo de trabalho.
  2. Sobreposição PDFs Aplica uma camada de carimbo pré-desenhada e aprovada.
  3. A cópia autenticada é arquivada no sistema de registros.
Aplicação de modelo em lote
  1. Um nó "Loop Over Items" itera sobre uma pasta de documentos recebidos de fornecedores.
  2. Sobreposição PDFs aplica a mesma camada PDF de um URL a cada um deles.
  3. Todos os documentos entram no arquivo com enquadramento consistente.

Dicas práticas

Test both orderings before a batch run
Swapping which file is base and which is layer changes what stays visible. Prove it on one sample pair rather than discovering it across a hundred documents.
Design the layer with transparency in mind
A layer PDF with a solid white background will hide the base underneath. Frames, borders, and letterheads work best when the middle is genuinely empty.
Match page sizes where you can
A layer built at the same page size as the base lines up predictably. Mismatched geometry is the usual reason a stamp lands in the wrong place.
Mix input types to avoid extra nodes
Keeping a static letterhead at a URL while the base arrives as binary from the previous node saves fetching the template into the workflow separately.
Reach for merge when page count should grow
If the second document is meant to be read after the first rather than on top of it, Merge Multiple PDFs is the correct action.
Check overlayCompleted alongside success
The output carries an explicit overlay confirmation flag, which is a more specific signal than the generic success boolean alone.

Folha de dicas

CampoValor
ActionOverlay PDFs
Base PDF Input TypeBinary Data
Layer PDF Input TypeBinary Data
Base PDF Binary Fielddata
Layer PDF Binary Fielddata
Output File Nameoverlayed_output.pdf
Binary Data Output Namedata
Advanced OptionsNo properties
CredentialsPDF4me API credential

Perguntas frequentes

What is the difference between overlaying PDFs and merging PDFs?+
Merging appends documents so the page count adds up and the files read one after another. Overlaying places the layer PDF on top of the base PDF on the same pages, so the page count does not grow and both sets of content appear together. Use overlay for letterheads, watermarks, and template stamps, and use merge when documents should follow each other.
Which file should be the base and which should be the layer?+
The base PDF is the background, and the layer PDF is placed on top of it, following the page content model described in the ISO 32000 PDF specification. For a letterhead applied to generated content, the content is usually the base and the branded template is the layer. If the layer has a solid background it can obscure what sits beneath, so test the order both ways on a sample first.
What happens if the two PDFs have different page counts?+
The two documents do not have to be identical, but the result is easiest to predict when they match or when the layer is a single page intended to repeat as a stamp. Run one representative pair through the node and inspect the output before committing a batch, since mismatched lengths are the most common cause of a surprising result.
Can the base and layer PDFs come from different sources?+
Yes. Base PDF Input Type and Layer PDF Input Type are set independently, so the base can arrive as Binary Data from a previous node in your n8n workflow while the layer is fetched from a URL, or any other combination.
Should I use Overlay PDFs or a watermark action for branding?+
Use a watermark action when you want simple text or a single image placed on the pages. Use Overlay PDFs when your branding already exists as a full PDF, such as a designed letterhead or a pre-approved certificate frame, because it preserves the layer document exactly as designed.

Ações relacionadas

Mesma tarefa em outras plataformas

Obtenha ajuda