Settings Reference
Where the Options Live
All of them are one attribute on the hidden settings tag, written as name=value pairs separated by semicolons.
<printfriendly-options style="display:none;"
data-content-features="disablePDF=0;hideImages=0;imageDisplayStyle=block;">
</printfriendly-options>Content Features
On data-content-features.
| Option | Values | What It Does |
|---|---|---|
disablePrintwas pfDisablePrint | 0 or 1 | Hides the Print action in the preview. |
disablePDFwas pfDisablePDF | 0 or 1 | Hides the PDF action. |
disableEmailwas pfDisableEmail | 0 or 1 | Hides the Email action. |
disableClickToDelwas pfdisableClickToDel | 0 or 1 | Stops readers removing parts of the page before printing. |
hideImageswas pfHideImages | 0 or 1 | Leaves images out of the printed page entirely. |
imageDisplayStylewas pfImageDisplayStyle | block, left, right, none | Where images sit: centered on their own line, floated, or left alone. |
headerImageUrlwas pfHeaderImgUrl | a URL | Your logo at the top of the printed page. |
headerTaglinewas pfHeaderTagline | text | A line of text under the header image. |
customCSSURLwas pfCustomCSS | a URL | A stylesheet to load into the printed page. |
showHiddenContentwas pfShowHiddenContent | 0 or 1 | Keeps content the page hides with CSS or script, such as closed tabs and accordions. Pro. |
encodeImageswas pfEncodeImages | 0 or 1 | Sends images from the reader's own browser instead of us fetching them from your server. Pro. Unset, this is on for http:// pages and off for https://. |
primaryImage | all, off, content-only | Chooses which image leads the article: off finds none, content-only skips the page's og:image/twitter:image meta tags and looks only inside the article. Only takes effect on Pro, where the page is read in the reader's browser; the free button ignores it. |
keepStyle | on | Keeps the inline style attributes your page's elements already carry, instead of stripping them. Only takes effect on Pro, where the page is read in the reader's browser; the free button ignores it. |
bgImageUrlSupport | on | Turns CSS background images into ordinary images so they show up in the printout. Only takes effect on Pro, where the page is read in the reader's browser; the free button ignores it. |
Content Selectors
On data-selectors, for telling us where the article is when we pick the wrong part of the page.
| Option | Values | What It Does |
|---|---|---|
contentSelectors | CSS selectors | Where the article lives, if we pick the wrong block. |
titleSelector | a CSS selector | Where the title lives. |
authorSelector | a CSS selector | Where the author's name lives. |
dateSelector | a CSS selector | Where the published date lives. |
primaryImageSelector | a CSS selector | Which image leads the article. |
removeSelectors | CSS selectors | Parts of the page to drop before printing. |
Common Questions
My old code uses pfDisablePDF and similar. Does it still work?#
Yes, and there is no deadline to change. Those globals were how settings were written before the settings tag existed, and the script still reads them. The table above lists the modern name for each one under "was".
<script>
var pfHeaderImgUrl = 'https://example.com/logo.png';
var pfDisableEmail = 1;
</script>If you set the same thing both ways, the settings tag wins. Do not do that, as it is a confusing thing to leave for whoever reads the page next.
How do I move from the old code to the current one?#
Generate a new one in the builder and replace the whole block. That is faster and less error-prone than converting by hand, and it picks up the current button markup at the same time.
You can tell which you have by looking for pfBtVersion in your page source.
Are the values 0 and 1, or true and false?#
Use 0 and 1. Note that the switches are worded as negatives: disablePDF=1 removes the PDF action, and disablePDF=0 leaves it in place.