Print Pro

Introduction

Print Pro gives apps the ability to print the current page, Print based on a custom stylesheet, skip elements, print an element, create a HTML template to insert dynamic data into or create a template with custom HTML, JavaScript, CSS & dynamic data all in one. This means no more APIs or 5 second+ wait times for an invoice, receipt, flyer or anything else you create.

How to setup

The plugin has 3 elements. You just need to place each of them on the page and get started.

Plugin fields, events, actions and states

PDF Viewer

Display content of an pdf file from given URL.

Fields

PDF URL - Link to the pdf file you want to view .

Exposed states

Viewer ID - return ID of viewer. Need to print this viewer by ID.

This element is powerful tool to print different things.

Exposed states

HTML Output - stores HTML code of printed things.

Actions

1) Print Elements

Action fields
Action fields
Action result

Fields

Page Title - Title of printed page. This text will be displayed at top of page.

ID of Elements to Print - Print an element by it's Id. The value should look like this "elementid" without #.

Import Pages's CSS? - Use .css files included on current page.

Import Page's Style? - Use styles from <style></style> tags of current page

External CSS Files URL - Import style from custom .css. Example of input value: https://www.w3schools.com/w3css/4/w3.css

Remove Inline Styles From Page? - Remove inline styles from print elements. Example of inline style: <div style="color:red;font-size:16px;">Text in 'style' is named inline style</div>

Set Print Delay (ms, More you print the longer this need's to be!) - Waiting time before printing starts.

Add HTML Header to Document? - This HTML content will be printed before element.

Add HTML Footer to Document? - This HTML content will be printed after element.

Copy Form Values? (Enhances the look of input fields) - Preserve input/form values.

Print Canvas Elements? - Copy canvas content

HTML Doc Type - Enter a different doctype for older markup

Debug Mode - Show the iframe for debugging

2) Print HTML Template

Print html content from field.

Action fields

Fields

custom HTML Template - HTML code for print

Timeout- Waiting time before printing starts.

Output the template but dont Print - Yes or No. If No Output the template but dont Print.

This action write in state HTML Output Printed HTML code

3) Print HTML Template (Advanced)

Action fileds
Action fields
Action fields

Fields

Custom CSS - Custom internal css code. Tags <style></style> should be used. Example:

  <style>
        body {
          background-color: yellow;
        }
  </style>

custom CSS URL - Custom external .css file. Example:

<link rel="stylesheet" href="https://your.url/filename.css">

Custom Head Javascript - Custom JavaScript code. Tags <script></script> should be used. Example:

    <script type="text/javascript">
      console.log('Hello from ZQ!');
    </script>

Custom Head Javascript URL - Custom script from source. Example:

<script src="https://your.url/filename.js"></script>

Custom Body Javascript - Custom JavaScript code. Tags <script></script> should be used. Example:

<script>
      let custom_script = 'Hello';
</script>

Custom Body Javascript URL - Custom script from source. Example:

<script src="https://your-another.url/filename.js"></script>

Custom Head HTML (remove tags!) - This HTML code will be writen in head of your HTML document. Tags <head></head> enabled by default. Example:

<meta charset="utf-8">
<title>Example</title>

Custom Body HTML (remove tags!) - Main HTML content of your page. Tags <body></body> enabled by default. Example:

    <div class="main">
      <div class="content">
        Content of page
      </div>
    </div>

Custom HTML Header - This HTML content will be displayed at the top of the page, before body content. Example:

    <header>
      <div>
        <span>Your custom header text</span>
      </div>
    </header>

Custom Footer HTML - This HTML content will be displayed at the bottom of the page, after body content. Example:

    <footer>
      <div class="custom">
        Footer content here
      </div>
    </footer>

Timeout- Waiting time before printing starts.

Output the template but dont Print - Yes or No. If No Output the template but dont Print.

Resulting HTML

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <!--   Custom CSS     -->
    <style>
        body {
          background-color: yellow;
        }
    </style>
    <!-- Custom CSS End   -->
    
    <!-- Custom CSS URL -->
    <link rel="stylesheet" href="https://your.url/filename.css">
    <!-- Custom CSS URL End -->
    
    <!-- Custom Head Javascript -->
    <script type="text/javascript">
      console.log('Hello from ZQ!');
    </script>
    <!-- Custom Head Javascript End -->
    
    <!-- Custom Head Javascript URL -->
    <script src="https://your.url/filename.js"></script>
    <!-- Custom Head Javascript URL End -->
    
    <!-- Custom Head HTML (remove tags!) -->
    <meta charset="utf-8">
    <title>Example</title>
    <!-- Custom Head HTML (remove tags!) End -->
  </head>
  <body>
    <!-- Custom HTML Header -->
    <header>
      <div>
        <span>Your custom header text</span>
      </div>
    </header>
    <!-- Custom HTML Header End -->
    
    <!-- Custom Body Javascript -->
    <script>
      let custom_script = 'Hello';
    </script>
    <!-- Custom Body Javascript End -->
    
    <!-- Custom Body Javascript URL -->
    <script src="https://your-another.url/filename.js"></script>
    <!-- Custom Body Javascript URL End -->
    
    <!-- Custom Body HTML (remove tags!) -->
    <div class="main">
      <div class="content">
        Content of page
      </div>
    </div>
    <!-- Custom Body HTML (remove tags!) End -->
    
    <!-- Custom Footer HTML -->
    <footer>
      <div class="custom">
        Footer content here
      </div>
    </footer>
    <!-- Custom Footer HTML End -->
  </body>
</html>

4) Print Whole Page

This action print current page using Styles of them.

5) Invoice Builder

Action fields
Action fields
Action fields
Result

6) Print Another Page

This action creates an iframe and prints its contents.

Fields

Time to Allow Loading - Waiting time befor printing. It need to wait while page is not loaded full.

Print Page Named - URL of page.

7) Print Element Inline styles

Print an element by ID.

Action fields

Fields

Element ID - id of element to print.

This element make preview for input HTML code.

Fields

HTML - HTML Code.

Last updated

Was this helpful?