Hi! Let’s pin down why your Marketo landing form prints blank (empty print preview, missing form area, or a totally white page). This usually comes from one of three buckets:
1) The form is inside an iframe and the browser can’t include it in print because of frame permission / cross-origin rules.
2) Security headers block framing: X-Frame-Options or Content-Security-Policy (CSP) frame-ancestors.
3) Print CSS hides the form (e.g., @media print sets display:none on the container).
Quick questions so we fix the right layer:
• Are you using Marketo Forms 2.0 embed code (script embed), or an iframe embed of a Marketo landing page?
• Does the form display fine on-screen but prints blank, or is it also blank/blocked in the browser view?
• Which browser(s): Chrome, Edge, Safari? Any differences in print preview?
• Do you see console errors like “Refused to display in a frame” or “blocked by frame-ancestors”?
Tell me those details and we’ll lock the iframe permission + print behavior so the Marketo form content actually prints.
Customer
We have a website page with a Marketo form embedded. On screen the form works and submissions go through. But when users try to print the page (or “Save as PDF”), the section where the form is becomes blank. In Chrome the print preview shows everything except the form area. We also have an iframe-based version for a partner portal, and that one sometimes shows a “refused to connect” type error in DevTools.
Great — you’ve basically described the two classic variants of the same issue:
• Script embed (Forms 2.0): the form renders via JavaScript and may be “reflowed” or hidden by print CSS or by browser print timing (the print snapshot happens before the embedded form finishes rendering).
• Iframe embed: printing often fails because the browser treats the iframe as a separate document, and cross-origin rules can prevent the print engine from capturing it. If security headers are strict, the iframe can also be blocked entirely by X-Frame-Options: SAMEORIGIN or CSP frame-ancestors.
The “refused to connect / refused to display” hint is a big sign of frame permission headers. We’ll do a quick check: verify whether the partner portal is allowed to frame the Marketo content, and then pick the best printing approach (print-friendly page or “open in new tab” for printing).
Customer
For our main site we use the Marketo embed script, not an iframe. For the partner portal, they insisted on an iframe that points to a Marketo landing page URL. In DevTools on that portal page we sometimes see errors mentioning X-Frame-Options or frame-ancestors. The portal has its own CSP. We can adjust headers on the portal, but we can’t change Marketo’s servers directly.
Perfect — let’s split the fix into two tracks (iframe permissions vs print behavior). First, the partner portal iframe issue:
Track A — Iframe blocked (frame permission)
If the browser console says the Marketo page is blocked by X-Frame-Options or CSP frame-ancestors, that’s not something the iframe HTML can override. Those are response headers that control whether the page is allowed to be framed at all.
What you can control on the portal side:
• Ensure the portal CSP allows loading Marketo content in frames: set/confirm CSP frame-src (or child-src in older CSP) includes the Marketo domain used for the landing page and form assets.
• Avoid adding a restrictive CSP like frame-ancestors 'none' on the portal if it accidentally applies to the framed content context or blocks needed assets.
• Confirm there’s no reverse-proxy/WAF adding its own X-Frame-Options: DENY on the framed endpoint.
If the Marketo landing page itself sends X-Frame-Options: SAMEORIGIN or a strict frame-ancestors policy, the stable workaround is: don’t iframe the landing page. Instead use the Marketo Forms 2.0 embed code in the portal page (script embed) so the portal page hosts the form, and you only allow the Marketo script and endpoints.
Customer
That matches what we’re seeing: sometimes the iframe just won’t load. But the bigger problem for us is printing. Even on the main site (script embed), the page prints without the form. We want the printed page to include what the user sees, or at least the filled values. Right now it’s blank in the form area.
Understood — “prints blank” with a script-embedded Marketo form is usually one of these:
1) Print snapshot happens before the form finishes rendering
The browser captures the print layout fast; if the Marketo form loads asynchronously (common with Forms 2.0), the print engine may capture the page before the form DOM is fully built.
2) Print stylesheet hides the container
Many sites have @media print rules that hide interactive elements (forms, buttons, embeds). If your CSS has something like form, iframe, .mktoForm { display:none; } in print mode, the form will disappear in print preview even if it’s visible on screen.
3) Browser “form field values” don’t print as expected
Some print engines don’t reliably print live input values unless styles force them, and some frameworks render fields in a way that prints as blank.
The quickest diagnostic: open DevTools, search your CSS for @media print and check whether .mktoForm, form, or the form wrapper is being hidden. If it is, we adjust print rules to show it (without changing your core layout).
Customer
We do have print CSS. It hides things like nav and buttons. I’m not sure about the Marketo form classes. Also, the marketing team is worried about security headers — they keep hearing “frame permission” and “same-origin” and think printing blank is the same issue as the iframe being blocked.
Great point — they’re related concepts, but we should separate them clearly:
• Frame permission (X-Frame-Options / CSP frame-ancestors) controls whether a page can be embedded in an iframe at all.
• Printing blank for a script-embedded Marketo form is usually print CSS or timing — the form is on the same page and not “blocked by XFO.”
Step 1 — Confirm whether print CSS hides the Marketo form
Look for rules under @media print that match any of these:
• .mktoForm (common Marketo Forms 2.0 class)
• your form wrapper div (often a marketing “form-section” container)
• generic rules like form { display:none; } or iframe { display:none; }
If found, the fix is conceptually simple: ensure the form wrapper and .mktoForm are not hidden in print mode.
Step 2 — Confirm the form exists in the DOM before printing
If users hit print too quickly, the Marketo script may still be loading. A practical workaround is to show a “Print-ready” state after the form load callback (so users don’t print a half-rendered page).
Customer
What about the partner portal iframe printing? Even when the iframe loads, print preview still doesn’t include the form content. It prints the page chrome but the iframe area is blank. Is that a browser limitation because the iframe is cross-domain?
Yes — that’s the “hard mode” scenario. Even if the iframe is allowed to load, printing cross-origin iframe content is often unreliable across browsers. Some print engines simply don’t capture the nested document (or they capture it before it finishes rendering), and you end up with a blank iframe area in the print output.
Step 3 — Use a print-friendly approach for iframe embeds
Best-practice options (pick what matches your constraints):
• Avoid iframe for the form: embed the Marketo form directly on the portal page using the official Embed Code (Forms 2.0 script). This usually fixes both frame permission headaches and print issues because everything is in one DOM.
• If the portal must iframe: add a “Open form in new tab” link that opens the Marketo landing page directly (top-level), then the user prints that page. Top-level printing is far more consistent than printing a framed page.
• If you need a “receipt”: generate a server-side confirmation/summary page (the values the user entered) and print that instead of printing the interactive form UI.
This is the fastest path to a reliable “not blank” print result without fighting browser restrictions.
Customer
Makes sense. For the portal we can add “open in new tab”. For the main site, we can tweak print CSS. But we also have a CSP on our site. Could our CSP be blocking Marketo scripts and causing the form to not render in print mode (or render too late)? We use strict policies and a CDN.
Definitely worth checking. A strict Content-Security-Policy can make a Marketo form look “fine on screen” for some users but behave oddly for others (different caching, blocked inline scripts, blocked form assets). It can also cause a delayed render that makes printing capture a blank container.
Step 4 — CSP checklist for Marketo embedded forms
In your CSP, confirm you’re not blocking Marketo resources needed to render the form:
• script-src: allow the Marketo forms script host used by your instance.
• connect-src: allow endpoints used for form submission/prefill.
• style-src / img-src: allow assets that render the form UI (logos, CSS, etc.).
• If you are using any iframes on the page: confirm frame-src allows the Marketo domain (this is separate from frame-ancestors, which controls who can embed you).
If you see console messages about blocked resources under CSP, that’s a strong signal. Fixing CSP will make the Marketo form render consistently and reduce “prints blank” timing failures.
Customer
After we removed a generic print rule that hid all form elements, the Marketo form finally shows in print preview. But the fields are still blank in the printed output (labels show, but values the user typed don’t show). Is there a way to print the filled values reliably?
Good progress — now we’re in the “printing form values” layer. Many browsers don’t reliably print live input values depending on how the fields are styled or rendered, and JavaScript-driven forms can behave differently between Chrome/Safari/Edge.
Reliable options (SEO-friendly and conversion-safe):
Option A — Print a confirmation/summary block
After the user fills the form (or after submit), display a simple summary section (plain text) that mirrors key fields (name, email, company, selected options). Plain text prints reliably and avoids the “blank inputs” issue. This also works as a print receipt and can be styled to print cleanly.
Option B — “Open print view” route
Provide a “Print” button that opens a lightweight “print view” page (same origin) and populates it with the current values. Then window.print() prints that view. This avoids cross-origin iframe printing and avoids the brittle “print the interactive form UI” approach.
If you want, I can outline the exact checklist to confirm whether the remaining problem is CSS (inputs hidden in print) or browser behavior — and we can pick the simplest approach for your setup.
Customer
That gives us a clear plan: fix print CSS for the embedded Marketo form, and for the iframe portal use “open in new tab” or a print view. Can you recap the main “accepted fix” and the frame permission part (X-Frame-Options/CSP) so we can document it for IT and marketing?
Absolutely. Here’s the clean recap for both teams:
Why the Marketo landing form prints blank
• On
script-embedded Marketo forms, “prints blank” is usually caused by
@media print CSS hiding the form (or the form rendering too late). Fix: ensure the form wrapper and
.mktoForm are visible in print mode, and avoid printing before the form finishes loading.
• On
iframe embeds, printing may still be blank because
cross-origin iframe printing is unreliable. Best workaround: avoid iframe and embed the form with the official Marketo embed code, or provide
open in new tab for printing, or print a confirmation/summary view instead.
Frame permission (why the iframe gets blocked)
• If you see “Refused to display in a frame” errors, it’s typically
X-Frame-Options or
CSP frame-ancestors blocking embedding. Those are server headers and can’t be fixed by changing the iframe HTML alone.
• On your site/portal, ensure CSP allows Marketo resources (
script-src,
connect-src, and if framing anything,
frame-src). If the Marketo page itself forbids framing, embed the form instead of iframing the landing page.
If you want an expert to review your exact headers (CSP/XFO), Marketo embed method, and print CSS so it’s solved end-to-end,
start a chat and we’ll walk through it step by step.
Why Marketo embedded forms print blank: iframe permissions vs print CSS
When a Marketo form prints blank, the root cause usually isn’t “printing” itself — it’s either how the form is embedded or what your security/print rules allow. With an iframe embed, browsers may not include cross-domain iframe content in print output, and the iframe may also be blocked outright by X-Frame-Options (like SAMEORIGIN) or by Content-Security-Policy using frame-ancestors. These headers are designed to prevent clickjacking and restrict framing.
With a Marketo Forms 2.0 script embed, the most common cause is a site-wide @media print stylesheet that hides form, iframe, or the Marketo wrapper (often .mktoForm), or the form loads asynchronously and the print engine captures the page before the form DOM is ready. Fixing print rules and ensuring the form is fully rendered before printing solves most “blank print preview” cases.
How to confirm it’s a frame permission issue (XFO/CSP) or a print rendering issue
Use DevTools to separate the problem fast. If the iframe shows console errors like “Refused to display in a frame,” check response headers for X-Frame-Options and CSP frame-ancestors — these control whether the page can be framed. If the form displays fine on-screen but disappears only in print preview, search your CSS for @media print rules and confirm the Marketo form wrapper (.mktoForm) isn’t hidden.
If print preview shows an empty rectangle where the iframe should be (even when the iframe loads normally), treat it as a cross-origin iframe printing limitation and switch to a more reliable flow: embed the form directly, open the form in a new tab for printing, or print a text-based confirmation/summary view that includes the entered values.
Marketo landing form prints blank — quick troubleshooting tips
Fix print CSS first, then verify frame permission headers (XFO/CSP) for iframe-based embeds.
Fast path: if it’s a script-embedded Marketo form, check @media print and remove any rules that hide form, iframe, or .mktoForm. Ensure users print after the form finishes loading. If it’s an iframe, look for X-Frame-Options and CSP frame-ancestors errors and avoid cross-domain iframe printing by using “open in new tab” or a dedicated print view/confirmation summary.
Disclaimer: This information is AI-generated and intended for general guidance only. For advice specific to your Marketo instance, CSP/XFO headers, and site setup, please consult a verified expert on Whizz-Tech before changing security headers.
Why does my Marketo landing page print blank only where the form is?
Most often it’s print CSS hiding the embedded form (for example, a rule under @media print that hides form or .mktoForm), or the form loads asynchronously and print preview captures the page before the Marketo form finishes rendering. If the form is inside a cross-domain iframe, the browser may not include iframe content in print output.
What does “frame permission” mean for Marketo forms?
“Frame permission” usually refers to security headers that control whether a page can be embedded in an iframe. X-Frame-Options and Content-Security-Policy frame-ancestors can block an iframe embed and cause errors like “Refused to display in a frame.” These headers are set by the server and can’t be bypassed by changing the iframe HTML.
How do I fix “Refused to display in a frame” when embedding a Marketo landing page?
Check the response headers for the framed page. If it sends X-Frame-Options: DENY/SAMEORIGIN or a restrictive frame-ancestors policy, it may not be embeddable. The stable workaround is to embed the Marketo form directly using the official Forms 2.0 embed code on your page, or open the landing page in a new tab instead of framing it.
How can I print the values a user typed into a Marketo form?
Instead of trying to print the interactive inputs, generate a simple confirmation/summary section (plain text) after the user fills or submits the form and print that. It prints reliably across browsers and avoids the common “labels print but values are blank” behavior for some styled input fields.