[{"data":1,"prerenderedAt":754},["Reactive",2],{"/alternatives/prince":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"dateModified":10,"author":11,"faq":12,"body":19,"_type":749,"_id":750,"_source":751,"_file":752,"_extension":753},"/alternatives/prince","alternatives",false,"","PrinceXML alternative: print HTML in a real browser","PDFShift prints your HTML in Chromium, scripts and charts included, from 50 free PDFs a month. We ran the same pages through Prince 17 to compare.","2026-11-18","Cyril Nicodème",[13,16],{"question":14,"answer":15},"Is Prince free?","Only for non-commercial use, and Prince's licence doesn't count invoices or receipts as non-commercial. The free version puts a watermark on its PDFs, and if you generate documents routinely, the page people download them from needs a link to princexml.com.",{"question":17,"answer":18},"Does Prince support CSS grid?","Yes, since Prince 16 (February 2025) on a single page, and since Prince 17 (September 2026) across pages too. None of DocRaptor's pipelines runs Prince 16 or 17.",{"type":20,"children":21,"toc":736},"root",[22,39,46,51,53,186,191,200,220,249,255,268,289,295,310,322,328,333,344,358,367,369,593,659,665,675,685,711,717,723,727,732],{"type":23,"tag":24,"props":25,"children":26},"element","p",{},[27,30,37],{"type":28,"value":29},"text","If your HTML was written for a browser, with a chart, data it fetches or a script that measures the page, print it in a browser. PDFShift runs Chromium for you, one POST per document. We sent the same page to Prince 17, the current version, and it couldn't run ",{"type":23,"tag":31,"props":32,"children":34},"code",{"className":33},[],[35],{"type":28,"value":36},"fetch()",{"type":28,"value":38},", measure a box or load Chart.js. PDFShift did all three.",{"type":23,"tag":40,"props":41,"children":43},"h2",{"id":42},"prince-17-and-pdfshift-on-the-same-two-pages",[44],{"type":28,"value":45},"Prince 17 and PDFShift on the same two pages",{"type":23,"tag":24,"props":47,"children":48},{},[49],{"type":28,"value":50},"On November 18, 2026, we ran two test pages through Prince 17 with its free non-commercial licence, and through PDFShift's free mode. The first tested what a browser gives a page, one script action per row:",{"type":28,"value":52},"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",{"type":23,"tag":54,"props":55,"children":56},"table",{},[57,87],{"type":23,"tag":58,"props":59,"children":60},"thead",{},[61],{"type":23,"tag":62,"props":63,"children":64},"tr",{},[65,71,76],{"type":23,"tag":66,"props":67,"children":68},"th",{},[69],{"type":28,"value":70},"What the script did",{"type":23,"tag":66,"props":72,"children":73},{},[74],{"type":28,"value":75},"PDFShift",{"type":23,"tag":66,"props":77,"children":78},{},[79,81],{"type":28,"value":80},"Prince 17 with ",{"type":23,"tag":31,"props":82,"children":84},{"className":83},[],[85],{"type":28,"value":86},"--javascript",{"type":23,"tag":88,"props":89,"children":90},"tbody",{},[91,113,139,165],{"type":23,"tag":62,"props":92,"children":93},{},[94,100,109],{"type":23,"tag":95,"props":96,"children":97},"td",{},[98],{"type":28,"value":99},"Changed text after a 300 ms timer",{"type":23,"tag":95,"props":101,"children":102},{},[103],{"type":23,"tag":104,"props":105,"children":106},"strong",{},[107],{"type":28,"value":108},"Ran",{"type":23,"tag":95,"props":110,"children":111},{},[112],{"type":28,"value":108},{"type":23,"tag":62,"props":114,"children":115},{},[116,126,134],{"type":23,"tag":95,"props":117,"children":118},{},[119,121],{"type":28,"value":120},"Loaded a JSON record with ",{"type":23,"tag":31,"props":122,"children":124},{"className":123},[],[125],{"type":28,"value":36},{"type":23,"tag":95,"props":127,"children":128},{},[129],{"type":23,"tag":104,"props":130,"children":131},{},[132],{"type":28,"value":133},"Ran: \"FETCH-OK: Leanne Graham\"",{"type":23,"tag":95,"props":135,"children":136},{},[137],{"type":28,"value":138},"Didn't run",{"type":23,"tag":62,"props":140,"children":141},{},[142,153,161],{"type":23,"tag":95,"props":143,"children":144},{},[145,147],{"type":28,"value":146},"Read a box's width with ",{"type":23,"tag":31,"props":148,"children":150},{"className":149},[],[151],{"type":28,"value":152},"getBoundingClientRect()",{"type":23,"tag":95,"props":154,"children":155},{},[156],{"type":23,"tag":104,"props":157,"children":158},{},[159],{"type":28,"value":160},"Ran: 300",{"type":23,"tag":95,"props":162,"children":163},{},[164],{"type":28,"value":138},{"type":23,"tag":62,"props":166,"children":167},{},[168,173,181],{"type":23,"tag":95,"props":169,"children":170},{},[171],{"type":28,"value":172},"Drew a bar chart with Chart.js 4.4.6",{"type":23,"tag":95,"props":174,"children":175},{},[176],{"type":23,"tag":104,"props":177,"children":178},{},[179],{"type":28,"value":180},"Drew it",{"type":23,"tag":95,"props":182,"children":183},{},[184],{"type":28,"value":185},"Script didn't load, canvas left blank",{"type":23,"tag":24,"props":187,"children":188},{},[189],{"type":28,"value":190},"Prince printed these errors:",{"type":23,"tag":192,"props":193,"children":195},"pre",{"code":194},"prince: chart.umd.min.js: error: ReferenceError: no such property: WeakMap\nprince: test2.html:18: error: ReferenceError: no such property: fetch\nprince: test2.html:19: error: TypeError: 'getBoundingClientRect': undefined is not a function\n",[196],{"type":23,"tag":31,"props":197,"children":198},{"__ignoreMap":7},[199],{"type":28,"value":194},{"type":23,"tag":201,"props":202,"children":203},"figure",{},[204,214],{"type":23,"tag":205,"props":206,"children":213},"img",{"src":207,"width":208,"height":209,"alt":210,"loading":211,"style":212},"/images/alternatives/prince-pdfshift-same-page.png",1954,668,"Two PDF pages side by side, both titled Browser features test. The PDFShift page on the left lists TIMER-RAN, FETCH-OK: Leanne Graham, MEASURED-WIDTH: 300 and CHARTJS-LOADED, above a purple bar chart with three bars. The Prince 17 page on the right lists TIMER-RAN, FETCH-NOT-RUN, MEASURE-NOT-RUN and CHARTJS-NOT-LOADED, with nothing below.","lazy","width:100%;height:auto",[],{"type":23,"tag":215,"props":216,"children":217},"figcaption",{},[218],{"type":28,"value":219},"Top of page 1 from both PDFs of the first test page, November 18, 2026. PDFShift's free mode adds the \"Created via PDFShift\" box, and Prince's free licence adds the logo at the top right.",{"type":23,"tag":24,"props":221,"children":222},{},[223,225,231,233,238,240,247],{"type":28,"value":224},"The second page was plainer: a CSS grid, a flexbox row with gaps, a CSS variable, a print stylesheet, an ",{"type":23,"tag":31,"props":226,"children":228},{"className":227},[],[229],{"type":28,"value":230},"@page",{"type":28,"value":232}," footer with \"Page 1 of 1\" and a short modern script. Both printed all of it, Prince once we turned on ",{"type":23,"tag":31,"props":234,"children":236},{"className":235},[],[237],{"type":28,"value":86},{"type":28,"value":239},". On DocRaptor, which still defaults to Prince 15.1, ",{"type":23,"tag":241,"props":242,"children":244},"a",{"href":243},"/alternatives/docraptor/",[245],{"type":28,"value":246},"the same grid stacked into one column",{"type":28,"value":248},".",{"type":23,"tag":40,"props":250,"children":252},{"id":251},"prince-runs-javascript-but-not-the-way-a-browser-does",[253],{"type":28,"value":254},"Prince runs JavaScript, but not the way a browser does",{"type":23,"tag":24,"props":256,"children":257},{},[258,260,266],{"type":28,"value":259},"Prince runs your scripts before it lays out the page, so a script can't measure anything yet. It can run a second time after layout to inspect the result, and ",{"type":23,"tag":31,"props":261,"children":263},{"className":262},[],[264],{"type":28,"value":265},"Prince.registerPostLayoutFunc",{"type":28,"value":267}," lays the page out again if that changes anything.",{"type":23,"tag":24,"props":269,"children":270},{},[271,273,279,281,287],{"type":28,"value":272},"So with Prince, do that work before you send the page: fetch the data and put it in the HTML, draw charts as SVG yourself, and write scripts for Prince, not for a browser. On PDFShift, the page runs as it does in Chrome. If a script needs time to finish, ",{"type":23,"tag":31,"props":274,"children":276},{"className":275},[],[277],{"type":28,"value":278},"wait_for",{"type":28,"value":280}," holds the PDF until a function you name returns true, or ",{"type":23,"tag":31,"props":282,"children":284},{"className":283},[],[285],{"type":28,"value":286},"delay",{"type":28,"value":288}," waits a fixed time.",{"type":23,"tag":40,"props":290,"children":292},{"id":291},"what-prince-costs-for-commercial-use",[293],{"type":28,"value":294},"What Prince costs for commercial use",{"type":23,"tag":24,"props":296,"children":297},{},[298,300,308],{"type":28,"value":299},"For a business, Prince sells a site licence: any number of your own servers, with upgrades and support, priced by quote. Prince says those \"",{"type":23,"tag":241,"props":301,"children":305},{"href":302,"rel":303},"https://www.princexml.com/purchase/",[304],"nofollow",[306],{"type":28,"value":307},"start around USD $2000 per year for startups",{"type":28,"value":309},"\". You still run the servers.",{"type":23,"tag":24,"props":311,"children":312},{},[313,315,321],{"type":28,"value":314},"PDFShift is priced per document, and we run the servers. The free plan gives 50 credits a month with no card, and paid plans start at $9 for 500. One credit covers a PDF up to 5 MB. A year of 50,000 PDFs a month costs $1,490, and 100,000 a month costs $2,490. See ",{"type":23,"tag":241,"props":316,"children":318},{"href":317},"/pricing/",[319],{"type":28,"value":320},"all plans",{"type":28,"value":248},{"type":23,"tag":40,"props":323,"children":325},{"id":324},"moving-a-prince-command-to-a-pdfshift-request",[326],{"type":28,"value":327},"Moving a Prince command to a PDFShift request",{"type":23,"tag":24,"props":329,"children":330},{},[331],{"type":28,"value":332},"A typical server call to Prince reads a file and writes a PDF:",{"type":23,"tag":192,"props":334,"children":339},{"code":335,"language":336,"meta":7,"className":337},"# Prince: https://www.princexml.com/doc/command-line/\nprince --javascript --baseurl=https://example.com/ invoice.html -o invoice.pdf\n","bash",[338],"language-bash",[340],{"type":23,"tag":31,"props":341,"children":342},{"__ignoreMap":7},[343],{"type":28,"value":335},{"type":23,"tag":24,"props":345,"children":346},{},[347,349,356],{"type":28,"value":348},"The same job on PDFShift is one request to our ",{"type":23,"tag":241,"props":350,"children":353},{"href":351,"rel":352},"https://docs.pdfshift.io/api-reference/convert-to-pdf",[304],[354],{"type":28,"value":355},"convert endpoint",{"type":28,"value":357},":",{"type":23,"tag":192,"props":359,"children":362},{"code":360,"language":336,"meta":7,"className":361},"curl https://api.pdfshift.io/v3/convert/pdf \\\n  -H \"X-API-Key: $PDFSHIFT_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"source\": \"https://example.com/invoice.html\", \"use_print\": true}' \\\n  -o invoice.pdf\n",[338],[363],{"type":23,"tag":31,"props":364,"children":365},{"__ignoreMap":7},[366],{"type":28,"value":360},{"type":28,"value":368},"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",{"type":23,"tag":54,"props":370,"children":371},{},[372,387],{"type":23,"tag":58,"props":373,"children":374},{},[375],{"type":23,"tag":62,"props":376,"children":377},{},[378,382],{"type":23,"tag":66,"props":379,"children":380},{},[381],{"type":28,"value":75},{"type":23,"tag":66,"props":383,"children":384},{},[385],{"type":28,"value":386},"Replaces this in Prince",{"type":23,"tag":88,"props":388,"children":389},{},[390,409,435,457,483,522,561,580],{"type":23,"tag":62,"props":391,"children":392},{},[393,404],{"type":23,"tag":95,"props":394,"children":395},{},[396,402],{"type":23,"tag":31,"props":397,"children":399},{"className":398},[],[400],{"type":28,"value":401},"source",{"type":28,"value":403},": your HTML or a URL",{"type":23,"tag":95,"props":405,"children":406},{},[407],{"type":28,"value":408},"The input file",{"type":23,"tag":62,"props":410,"children":411},{},[412,425],{"type":23,"tag":95,"props":413,"children":414},{},[415,417,423],{"type":28,"value":416},"Scripts run by default. ",{"type":23,"tag":31,"props":418,"children":420},{"className":419},[],[421],{"type":28,"value":422},"disable_javascript: true",{"type":28,"value":424}," turns them off",{"type":23,"tag":95,"props":426,"children":427},{},[428,433],{"type":23,"tag":31,"props":429,"children":431},{"className":430},[],[432],{"type":28,"value":86},{"type":28,"value":434},", off by default",{"type":23,"tag":62,"props":436,"children":437},{},[438,452],{"type":23,"tag":95,"props":439,"children":440},{},[441,450],{"type":23,"tag":104,"props":442,"children":443},{},[444],{"type":23,"tag":31,"props":445,"children":447},{"className":446},[],[448],{"type":28,"value":449},"use_print: true",{"type":28,"value":451},", or PDFShift uses your screen CSS",{"type":23,"tag":95,"props":453,"children":454},{},[455],{"type":28,"value":456},"Print media, Prince's default",{"type":23,"tag":62,"props":458,"children":459},{},[460,472],{"type":23,"tag":95,"props":461,"children":462},{},[463,465,470],{"type":28,"value":464},"Send a URL as ",{"type":23,"tag":31,"props":466,"children":468},{"className":467},[],[469],{"type":28,"value":401},{"type":28,"value":471},", or use absolute URLs in your HTML",{"type":23,"tag":95,"props":473,"children":474},{},[475,481],{"type":23,"tag":31,"props":476,"children":478},{"className":477},[],[479],{"type":28,"value":480},"--baseurl",{"type":28,"value":482}," for relative files",{"type":23,"tag":62,"props":484,"children":485},{},[486,512],{"type":23,"tag":95,"props":487,"children":488},{},[489,495,497,503,505,510],{"type":23,"tag":31,"props":490,"children":492},{"className":491},[],[493],{"type":28,"value":494},"format",{"type":28,"value":496}," and ",{"type":23,"tag":31,"props":498,"children":500},{"className":499},[],[501],{"type":28,"value":502},"margin",{"type":28,"value":504},". ",{"type":23,"tag":31,"props":506,"children":508},{"className":507},[],[509],{"type":28,"value":230},{"type":28,"value":511}," margin boxes still print",{"type":23,"tag":95,"props":513,"children":514},{},[515,520],{"type":23,"tag":31,"props":516,"children":518},{"className":517},[],[519],{"type":28,"value":230},{"type":28,"value":521}," size and margins",{"type":23,"tag":62,"props":523,"children":524},{},[525,556],{"type":23,"tag":95,"props":526,"children":527},{},[528,534,535,541,543,549,550],{"type":23,"tag":31,"props":529,"children":531},{"className":530},[],[532],{"type":28,"value":533},"header",{"type":28,"value":496},{"type":23,"tag":31,"props":536,"children":538},{"className":537},[],[539],{"type":28,"value":540},"footer",{"type":28,"value":542},", with ",{"type":23,"tag":31,"props":544,"children":546},{"className":545},[],[547],{"type":28,"value":548},"{{page}}",{"type":28,"value":496},{"type":23,"tag":31,"props":551,"children":553},{"className":552},[],[554],{"type":28,"value":555},"{{total}}",{"type":23,"tag":95,"props":557,"children":558},{},[559],{"type":28,"value":560},"Running headers and page counters",{"type":23,"tag":62,"props":562,"children":563},{},[564,575],{"type":23,"tag":95,"props":565,"children":566},{},[567,573],{"type":23,"tag":31,"props":568,"children":570},{"className":569},[],[571],{"type":28,"value":572},"sandbox: true",{"type":28,"value":574}," for free test PDFs with a watermark",{"type":23,"tag":95,"props":576,"children":577},{},[578],{"type":28,"value":579},"The free licence's watermark",{"type":23,"tag":62,"props":581,"children":582},{},[583,588],{"type":23,"tag":95,"props":584,"children":585},{},[586],{"type":28,"value":587},"An API key, no licence file",{"type":23,"tag":95,"props":589,"children":590},{},[591],{"type":28,"value":592},"A licence file on every server",{"type":23,"tag":24,"props":594,"children":595},{},[596,598,604,606,612,614,620,621,627,628,634,635,641,643,649,651,657],{"type":28,"value":597},"Before you move a template, search it for ",{"type":23,"tag":31,"props":599,"children":601},{"className":600},[],[602],{"type":28,"value":603},"prince-",{"type":28,"value":605}," properties, ",{"type":23,"tag":31,"props":607,"children":609},{"className":608},[],[610],{"type":28,"value":611},"position: running()",{"type":28,"value":613},", ",{"type":23,"tag":31,"props":615,"children":617},{"className":616},[],[618],{"type":28,"value":619},"float: footnote",{"type":28,"value":613},{"type":23,"tag":31,"props":622,"children":624},{"className":623},[],[625],{"type":28,"value":626},"string-set",{"type":28,"value":613},{"type":23,"tag":31,"props":629,"children":631},{"className":630},[],[632],{"type":28,"value":633},"target-counter()",{"type":28,"value":496},{"type":23,"tag":31,"props":636,"children":638},{"className":637},[],[639],{"type":28,"value":640},"leader()",{"type":28,"value":642},": those are Prince features, and Chromium doesn't read them. To see a template at A4 with its print CSS first, paste it into our ",{"type":23,"tag":241,"props":644,"children":646},{"href":645},"/tools/html-viewer/",[647],{"type":28,"value":648},"HTML viewer",{"type":28,"value":650},". Then ",{"type":23,"tag":241,"props":652,"children":654},{"href":653},"/register/",[655],{"type":28,"value":656},"create a free account",{"type":28,"value":658}," and send it.",{"type":23,"tag":40,"props":660,"children":662},{"id":661},"other-princexml-alternatives",[663],{"type":28,"value":664},"Other PrinceXML alternatives",{"type":23,"tag":24,"props":666,"children":667},{},[668,673],{"type":23,"tag":104,"props":669,"children":670},{},[671],{"type":28,"value":672},"Prince as a hosted API:",{"type":28,"value":674}," DocRaptor and EuroPDF run Prince for you.",{"type":23,"tag":24,"props":676,"children":677},{},[678,683],{"type":23,"tag":104,"props":679,"children":680},{},[681],{"type":28,"value":682},"Hosted APIs on Chromium,",{"type":28,"value":684}," like PDFShift: Api2Pdf, PDFBolt and CustomJS. Browserless hosts browsers for your own Puppeteer or Playwright code.",{"type":23,"tag":24,"props":686,"children":687},{},[688,693,695,701,703,709],{"type":23,"tag":104,"props":689,"children":690},{},[691],{"type":28,"value":692},"Engines you run yourself:",{"type":28,"value":694}," WeasyPrint and PDFreactor have their own layout engines, and wkhtmltopdf's repository has been archived since January 2023. Puppeteer and Playwright drive Chromium on your server (our ",{"type":23,"tag":241,"props":696,"children":698},{"href":697},"/alternatives/puppeteer/",[699],{"type":28,"value":700},"Puppeteer alternatives",{"type":28,"value":702}," page covers them), and ",{"type":23,"tag":241,"props":704,"children":706},{"href":705},"/alternatives/gotenberg/",[707],{"type":28,"value":708},"Gotenberg",{"type":28,"value":710}," puts Chromium in a Docker container.",{"type":23,"tag":40,"props":712,"children":714},{"id":713},"frequently-asked-questions",[715],{"type":28,"value":716},"Frequently asked questions",{"type":23,"tag":718,"props":719,"children":721},"h3",{"id":720},"is-prince-free",[722],{"type":28,"value":14},{"type":23,"tag":24,"props":724,"children":725},{},[726],{"type":28,"value":15},{"type":23,"tag":718,"props":728,"children":730},{"id":729},"does-prince-support-css-grid",[731],{"type":28,"value":17},{"type":23,"tag":24,"props":733,"children":734},{},[735],{"type":28,"value":18},{"title":7,"searchDepth":737,"depth":737,"links":738},2,[739,740,741,742,743,744],{"id":42,"depth":737,"text":45},{"id":251,"depth":737,"text":254},{"id":291,"depth":737,"text":294},{"id":324,"depth":737,"text":327},{"id":661,"depth":737,"text":664},{"id":713,"depth":737,"text":716,"children":745},[746,748],{"id":720,"depth":747,"text":14},3,{"id":729,"depth":747,"text":17},"markdown","content:alternatives:prince.md","content","alternatives/prince.md","md",1795010757996]