Editorial Workflows

PDF with page numbers

unlisted workflow

Install Workflow...

This workflow contains at least one Python script. Only use it if you trust the person who shared this with you, and if you know exactly what it does.

I understand, install the workflow!

This is a workflow for Editorial, a Markdown and plain text editor for iOS. To download it, you need to view this page on a device that has the app installed.

Description: Converts the current Markdown document to a PDF, and then adds header/footer text to the PDF, using Python (reportlab/PyPDF2). Header/footer text can include page numbers.

Quite a few options are configurable in the (custom) "Add PDF Header/Footer" action.

Shared by: @olemoritz

Comments: Comment Feed (RSS)

@cclauss — 20 Apr 2017
Please consider adding header.rstrip() and footer.rstrip() to the processing. A \n at the end of these fields results in a black square in the .pdf file.
@olemoritz — 20 Apr 2017
Done.

+ Add Comment

Workflow Preview
If… ?
Run the block if
%editor:syntax-mode
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
markdown
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
ON
Message
Open a Markdown Document
…End If
Document Text ?
Folded Text
  • Include
  • Replace with:
Convert Markdown ?
Markdown Extras: Footnotes
ON
…Auto-Links
ON
…Strikethrough (~~x~~)
ON
…Superscript (^x)
ON
…Tables
ON
…Smart Quotes etc.
ON
…Strip Metadata Headers
OFF
Generate PDF Document ?
Source
  • HTML Code
  • Web URL
HTML/URL
<!DOCTYPE html> <html> <head><meta charset="utf-8"/> <style> body { font-family: helvetica; font-size: 12pt; } h1 { font-size: 18pt; } h2 { font-size: 16pt; } h3 { font-size: 14pt; } h4, h5, h6 { font-size: 12pt; } a { color: black; } </style> </head> <body> Input </body> </html>
Paper Size
  • A4
  • Letter
Page Margins
2cm 2.5cm 2cm 2.5cm
Filename
Output.pdf
in Dropbox
OFF
Overwrite
ON
Add PDF Header/Footer ?
Open URL ?
Open in
  • In-App Browser
  • Default App / Safari
URL
Input
Tab
  • Last-used Tab
  • New Tab
  • Tab with ID:
Unique identifier
Wait until Loaded
OFF
Reveal Browser Automatically
ON