Use Apple Shortcuts to generate PDFs from markdown using refile’s API directly from your iOS or macOS device.

Demo Shortcut

Get started quickly by installing our demo shortcut:

Install refile Demo Shortcut

Creating Your Own Shortcut

Follow these steps to create a custom refile shortcut:

  1. Open the Shortcuts app on your iOS or macOS device
  2. Create a new shortcut
  3. Add a “Text” action to input your markdown content
  4. Add a “Get Contents of URL” action with the following settings:
    • URL: https://www.refile.co/api/v1/pdf/markdown
    • Method: POST
    • Headers:
      • Name: Authorization
      • Value: Bearer YOUR_API_KEY (replace with your actual API key)
    • Request Body: JSON
    • JSON:
    {
    	"markdown": "[Shortcut Input]",
    	"output": "binary",
    	"theme": "modern"
    }
    
  5. (optional) Add a “Quick Look” action to preview the PDF

Customization Options

You can customize your shortcut by modifying the JSON payload:

  • theme: Choose from various themes
  • pageNumeration: Add page numbers with “center”, “left”, “right” or “none”
  • pageSize: Set page dimensions like “A4”, “Letter”, “Legal”
  • output: Use “url” to get a download link or “binary” for direct PDF data

See the API documentation for all available options.