Do you want to inspect the raw HTML output of a Gravity PDF document?
Gravity PDF normally takes your PDF template, processes the form entry data, applies the template markup, and then renders the final PDF file in the browser. That final PDF is what users usually see.
However, when you are working on PDF styling or template layout, viewing only the final PDF can make troubleshooting harder. You may want to see the HTML markup that Gravity PDF sends to the PDF renderer before it becomes a PDF.
That is where the ?html=1 helper parameter can help.
By adding ?html=1 to a Gravity PDF URL, you can view the generated HTML output directly in the browser. This makes it easier to inspect the markup, review styling, and troubleshoot layout issues in a custom Gravity PDF template.
When should you view Gravity PDF as raw HTML?
Viewing the raw HTML output is mainly useful for development and troubleshooting. It is not meant to replace the normal PDF link that users receive or download.
Use the raw HTML view when you want to:
- Check the HTML generated by a custom PDF template
- Inspect how merge tags and form values appear before PDF rendering
- Troubleshoot layout issues
- Review missing or incorrect CSS
- Test whether content is being added to the template correctly
- Compare the browser HTML view with the final PDF output
For normal users, you should still link to the generated PDF file. The raw HTML view is mostly for admins, developers, and site owners who are styling or debugging Gravity PDF templates.
Raw HTML vs. normal PDF link
A normal Gravity PDF link opens the finished PDF document.
A raw HTML view shows the generated HTML before Gravity PDF renders it as a PDF. This is useful because PDF rendering can behave differently from a normal webpage. A layout issue may come from the HTML structure, the CSS, or the way the PDF renderer supports certain styles.
| Option | What it shows | Best used for |
|---|---|---|
| Normal PDF URL | The finished PDF document | Users, downloads, email attachments, and final review |
PDF URL with ?html=1 | The generated HTML markup | Debugging, styling, and template development |
If you only want to view or download the document, use the normal PDF URL. If you are trying to understand why the PDF layout looks wrong, use the raw HTML view.
Step 1: Open the Gravity PDF URL
First, open a generated Gravity PDF file in your browser.
The PDF URL may look similar to this:
https://gravitywp.com/pdf/5e3ebbb1cb8e3/18823/
This is the normal PDF URL. When you open it, Gravity PDF renders the document as a PDF.
You usually need permission to access the PDF. As an administrator, you can normally open generated PDFs from the WordPress dashboard or from the Gravity PDF settings connected to the entry.
Step 2: Add ?html=1 to the PDF URL
To view the raw HTML output, add ?html=1 to the end of the PDF URL.
Example:
https://gravitywp.com/pdf/5e3ebbb1cb8e3/18823/?html=1
Here is what the parameter does:
? starts the URL query string
html tells Gravity PDF which helper parameter to use
=1 enables the raw HTML output view
After adding the parameter, reload the page. Instead of showing the processed PDF, Gravity PDF displays the generated HTML markup in the browser.
This is the HTML that Gravity PDF prepares before rendering the final PDF document.

More about styling PDF’s
For generating PDF’s the mPDF library is used. There are some limitations and differences between writing HTML and CSS for PDF’s compared with webpages.
Compatibility note for Gravity PDF 6.4+
In Gravity PDF 6.4 and newer, the html=1 helper parameter is only available when Debug Mode is enabled or when the WordPress environment is not set to production.
That means the raw HTML view may not work on a live production site unless the correct development/debug conditions are enabled.
This is a helpful security and development safeguard because raw template output is mainly intended for debugging, not for public use.
If adding ?html=1 does not show the raw HTML, check whether:
- You are using Gravity PDF 6.4 or newer
- Debug Mode is enabled
- The site environment is set for development or staging
- You are logged in with the right permissions
- The PDF URL is valid
For live websites, it is usually better to test raw HTML output in a staging or development environment.
Step 3: Inspect the generated HTML
Once the raw HTML output is visible, you can inspect the structure of the PDF template.
Look for:
- The field values added from the Gravity Forms entry
- The HTML elements used in the PDF template
- Inline styles or linked stylesheets
- Missing images or broken paths
- Unexpected spacing or wrapper elements
- Content that appears in the HTML but not in the final PDF
This can help you separate template problems from PDF rendering problems.
For example, if a field value does not appear in the raw HTML, the issue may be in the template, merge tag, or form data. If the field value appears in the raw HTML but looks wrong in the final PDF, the issue may be related to styling or PDF rendering support.
Step 4: Compare the raw HTML with the final PDF
After checking the raw HTML, open the normal PDF URL again and compare the final output.
Use this comparison to find where the issue starts:
| What you see | What it usually means |
|---|---|
| Content is missing from both the raw HTML and final PDF | The template may not be outputting the data correctly |
| Content appears in raw HTML but not in the PDF | The PDF renderer may not support the styling or layout used |
| CSS works in the browser but not in the PDF | The CSS may not be supported by the PDF rendering library |
| Images are broken in the PDF | The image path may not be accessible to the PDF renderer |
| Spacing looks different in the PDF | The PDF renderer may handle margins, padding, or layout differently |
This step is important because a PDF is not the same as a normal webpage. Some HTML and CSS that work in a browser may behave differently when converted into a PDF.
Common pitfalls when viewing Gravity PDF in raw HTML
The raw HTML view does not load
If the normal PDF opens but the raw HTML view does not, check your Gravity PDF version and debug settings. In Gravity PDF 6.4 and newer, helper parameters like html=1 are limited to debug or non-production environments.
Also confirm that you are logged in with the correct permissions.
The URL already has a question mark
If the PDF URL already contains a query string, do not add another question mark.
Use &html=1 instead.
Example:
https://example.com/pdf/abc123/456/?download=1&html=1
Use ?html=1 when there are no existing URL parameters. Use &html=1 when the URL already has a parameter.
The final PDF looks different from the HTML view
This can happen because PDF rendering is not the same as browser rendering. The HTML view helps you inspect the markup, but the PDF renderer may support only certain HTML and CSS features.
If your layout looks correct in raw HTML but not in the PDF, review the HTML and CSS support available in Gravity PDF and mPDF.
Images do not appear correctly
Broken images are often caused by file paths or permissions.
When working with custom Gravity PDF templates, make sure the image path can be accessed during PDF generation. A path that works in a normal browser view may not always work during PDF rendering.
The wrong PDF template appears
If the output does not look like the template you expected, check the PDF settings for that form. Make sure the correct template is selected and that you are opening the right PDF URL for the entry.
More about styling PDFs
Gravity PDF uses the mPDF library to generate PDF documents. Because of this, styling a PDF is not exactly the same as styling a normal webpage.
Some HTML and CSS features work well in a browser but may have limitations inside a PDF. When styling Gravity PDF templates, it is best to keep the markup clean and use CSS that is supported by the PDF renderer.
If your raw HTML looks correct but the final PDF does not, the issue may be related to PDF rendering limitations rather than the template output itself.
For more information about Gravity PDF and related resources, see our Gravity PDF for Gravity Forms page.
Final thoughts
Viewing a Gravity PDF in raw HTML is a simple but useful debugging method. By adding ?html=1 to the PDF URL, you can inspect the generated template output before Gravity PDF turns it into a PDF document.
Use this when you are troubleshooting custom templates, missing values, layout issues, or styling problems. Then compare the raw HTML view with the final PDF to understand whether the problem starts in the template or during PDF rendering.
For best results, use this method in a development or staging environment, especially if you are using Gravity PDF 6.4 or newer.
Frequently asked questions
?html=1 do in Gravity PDF? The ?html=1 helper parameter shows the generated HTML output of a Gravity PDF document before it is rendered as a PDF. This is useful when debugging templates, styles, and layout issues.
No. Regular users should usually see the finished PDF, not the raw HTML output. The raw HTML view is mainly for admins, developers, and site owners working on PDF templates.
?html=1 not work on my live site? If you are using Gravity PDF 6.4 or newer, the helper parameter is only available when Debug Mode is enabled or when the WordPress environment is not set to production. You may need to test this on a staging or development site.
Yes. If a value is missing from the final PDF, checking the raw HTML can help you see whether the value is missing from the template output or only failing during PDF rendering.
No. The raw HTML output shows the markup before PDF rendering. The final PDF may look different because the PDF renderer handles some HTML and CSS differently from a browser.
Our Premium add-ons for Gravity Forms
n8n Connector
Connect Gravity Forms to n8n and automate your workflows with secure, flexible, and powerful webhooks. Go beyond simple notifications and build advanced, two-way automations.
Advanced Number Field
Functionality for Number Fields, like rounding or only absolute numbers, fixed point notation, range calculation, custom units like % or m2 & show as slider.
DateTime Field
The GravityWP - DateTime Field add-on adds a dedicated Date/Time field to Gravity Forms so users can enter both a date and a time in a single input.
All Entries
All your new Gravity Forms entries in one central place. Stop navigating between multiple forms to find new entries. Get immediate oversight and full control with a powerful, unified dashboard.
Read tutorials about
Gravity Forms Zoho CRM Integration: How to Auto-Populate Form Fields by Email
Learn how to auto-populate Gravity Forms from Zoho CRM using GravityWP API Connector. This tutorial shows how to search Zoho Contacts by email and fill form fields with the returned data.
How to Create a Public Submission Business Directory in WordPress (Gravity Forms + GravityView)
Build a moderated business directory where users submit listings through a form, admins approve entries, and approved businesses appear in a searchable GravityView directory.
How to Create an Event Workshop Registration + Waitlist System in WordPress
This guide shows how to set up a workshop registration + waitlist system in WordPress: register attendees until capacity is reached, waitlist the rest, approve entries, and auto-promote people when a seat opens using Gravity Forms, Gravity Flow, and GravityView.
Gravity Flow Form Submission Step Tutorial
The Gravity Flow Form Submission step pauses a workflow until another form is submitted, then continues once the handoff is complete. This guide shows how to connect two forms, prefill fields with mapping, send the correct secure link, and troubleshoot the most common “workflow didn’t move” issues.