1. Home
  2. Docs
  3. Guidelines & instructions
  4. First steps with WooPDF

First steps with WooPDF

WooCommerce PDF Attachments admin panel can be accessed from WordPress admin toolbar (WooCommerce -> PDF Attachments). From there, you can add, edit or remove attachments.

Main dashboard

How to add new WooCommerce PDF Attachment?

After you click on “Add new” button displayed in the header of main dashboard page. You will be redirected to the editor where you can add your PDF content and maintain its settings (using metaboxes displayed below the content editor).

Text editor

WooPDF supports all basic HTML tags and it is also possible to copy & paste the text content from offline editors such as Microsoft Word. The editor is not displayed if Use uploaded/imported PDF  is selected in General Settings -> Mode.

Dynamic content shortcodes

If you select Generate PDF for each order (dynamic content) mode you will be able to use dynamic content shortcodes listed in the side metabox:

General settings

  • Disable
    If you check this option, the PDF attachment will stay inactive and the generator will not be triggered and the PDF will not be attached to WooCommerce emails.
  • Attach PDF to all products (Products)?
    If enabled the PDF will not be limited to any product and attached to selected WooCommerce emails. If disabled, a second field “Products” will be displayed below where you can select products. Then, if your customer order any of selected products PDF will be attached to the WooCommerce email.

  • Email Types
    Using this field you can select all WooCommerce transaction emails to whose the PDF will be attached.

  • Mode
    You can select one of three modes:

    1. Use uploaded/imported PDF
      To make it working please paste the full URL of PDF (if hosted elsewhere, the file will be imported to your server) or select it from Media Library (with Select PDF) button in Attachment PDF URL field displayed below.

      You can find more detailed description here.

    2. Generate PDF only once (static content)
      If this option is selected, PDF will be generated only when PDF attachment post is saved or updated. In this mode no dynamic tags cannot be used!

      You can find more detailed description here.

    3. Generate PDF for each order (dynamic content)
      In this mode the PDF will be generated on-fly with dynamic content and the PDF text may contain dynamic shortcodes, eg. customer name, address, order id, order total value, order comments and so on.

      You can find more detailed description here.

  • Attachment filename
    If you select either Generate PDF only once (static content) or Generate PDF for each order (dynamic content) mode you will be able to set the attachment filename (displayed in email attachment).

Metadata & PDF Format

  • Title & Author
    The fields values will be displayed in PDF properties as metadata.
  • PDF Paper Size
    By default it is set to A4, but you can select also another formats:

    • all ISO 216 formats including A3, B2, C4 etc.
    • all ANSI formats
    • American formats: Letter, Legal, Junior Legal, Tabloid/Ledger
    • custom format (in mm/cm/in or points)
  • PDF Orientation
    You can select either portrait or landscape mode.
  • PDF Margins
    The margins indicate how far from the paper sides the text content will be placed.

Header & Footer

This section may be useful if you would like to display additional short text with eg. your company details or another information.

Header & Footer in PDF output

PDF Appearance

In this metabox you can change the default text color, font family & size + adjust the appearance of header and footer. You can also define some basic CSS rules.

Was this article helpful to you? Yes No

How can we help?