[{"data":1,"prerenderedAt":2548},["ShallowReactive",2],{"blog-\u002Fblog\u002F2025\u002F05\u002Fhow-to-generate-pdf-reports-using-node-red":3},{"id":4,"title":5,"body":6,"description":12,"extension":2538,"meta":2539,"navigation":1443,"path":2544,"seo":2545,"stem":2546,"__hash__":2547},"blog\u002Fblog\u002F2025\u002F05\u002Fhow-to-generate-pdf-reports-using-node-red.md","How to Generate PDF Reports Using Node-RED in FlowFuse",{"type":7,"value":8,"toc":2527},"minimark",[9,13,16,21,24,64,68,71,76,85,104,107,119,123,126,129,132,357,366,369,1300,1303,1313,1317,1320,1325,1328,1333,1351,1362,1371,2169,2218,2225,2228,2232,2235,2240,2341,2344,2349,2353,2356,2392,2395,2398,2406,2496,2501,2511,2515,2524],[10,11,12],"p",{},"Generating PDF reports is a common need in many workflows—whether you're logging data, sharing results, or creating summaries. With Node-RED and FlowFuse, you can easily automate turning your data into well-structured PDF files. This guide will show you how to set up step-by-step PDF report generation using simple tools and flows.",[10,14,15],{},"Generating reports allows you to capture snapshots of critical data, summarize system activities, and distribute insights in an easy-to-read and stored format. PDF is one of the most universally accepted formats for sharing documents, making it ideal for delivering structured information from your Node-RED flows.",[17,18,20],"h2",{"id":19},"prerequisites","Prerequisites",[10,22,23],{},"Before you begin, make sure the following requirements are met:",[25,26,27,39,48],"ul",{},[28,29,30,31,38],"li",{},"You have an active ",[32,33,37],"a",{"href":34,"rel":35},"https:\u002F\u002Fapp.flowfuse.com",[36],"nofollow","FlowFuse account"," and a running FlowFuse instance.",[28,40,41,42,47],{},"You are familiar with creating and deploying basic flows in Node-RED. If not, consider taking the ",[32,43,46],{"href":44,"rel":45},"https:\u002F\u002Fnode-red-academy.learnworlds.com\u002Fcourse\u002Fnode-red-getting-started",[36],"Node-RED Fundamentals Course"," sponsored by FlowFuse.",[28,49,50,51,55,56,59,60,63],{},"Ensure you have installed ",[52,53,54],"code",{},"flowfuse\u002Fnode-red-dashboard"," ",[52,57,58],{},"@flowfuse\u002Fnode-red-dashboard-2-ui-iframe"," and ",[52,61,62],{},"node-red-contrib-sqlite"," (The SQLite node is required for the demo data generation flow we provided. If you're not using that flow, you can skip this.).",[17,65,67],{"id":66},"setting-up-pdf-generation-in-node-red","Setting Up PDF Generation in Node-RED",[10,69,70],{},"Once the prerequisites are in place, the next step is setting up your Node-RED environment to generate PDF reports. In this section, we will go over how to install the necessary Node-RED node and configure a flow to generate PDF reports.",[72,73,75],"h3",{"id":74},"step-1:-install-the-@platmac\u002Fnode-red-pdfbuilder","Step 1: Install the @platmac\u002Fnode-red-pdfbuilder",[10,77,78,79,84],{},"The ",[32,80,83],{"href":81,"rel":82},"https:\u002F\u002Fflows.nodered.org\u002Fnode\u002F@platmac\u002Fnode-red-pdfbuilder",[36],"platmac\u002Fnode-red-pdfbuilder"," node is the primary node for creating PDF reports in Node-RED. To install this node:",[86,87,88,91,94,101],"ol",{},[28,89,90],{},"Open your Node-RED editor.",[28,92,93],{},"Navigate to the \"Manage palette\" section from the top-right menu.",[28,95,96,97,100],{},"Click on the \"Install\" tab and search for ",[52,98,99],{},"@platmac\u002Fnode-red-pdfbuilder",".",[28,102,103],{},"Click \"Install\" to add the node to your palette.",[10,105,106],{},"This node allows you to dynamically generate PDFs from various inputs, which is exactly what you will need to generate reports.",[10,108,109,110,113,114,59,116,118],{},"If you haven't installed the ",[52,111,112],{},"@flowfuse\u002Fnode-red-dashboard",", ",[52,115,58],{},[52,117,62],{}," nodes, you can install them similarly.",[72,120,122],{"id":121},"step-2:-understanding-how-to-use-the-pdfbuilder-node","Step 2: Understanding How to Use the Pdfbuilder Node",[10,124,125],{},"Now that the required node is installed, let's dive into how to use it and how to leverage the different attributes to customize your PDF reports. The pdfbuilder node in Node-RED simplifies generating PDFs by allowing you to define content, layout, and styling directly in your flow.",[10,127,128],{},"The key advantage of using pdfbuilder node is that it operates server-side, meaning PDFs can be generated automatically without a browser or manual interaction. This makes it ideal for automated workflows where consistent, programmatically created documents are needed.",[10,130,131],{},"When working with this node, you can use various attributes to customize the content and layout of the PDF, such as text, tables, images, page sizes, margins, headers, footers, and more. Below are the most commonly used attributes:",[133,134,135,158],"table",{},[136,137,138],"thead",{},[139,140,141,148,153],"tr",{},[142,143,144],"th",{},[145,146,147],"strong",{},"Attribute",[142,149,150],{},[145,151,152],{},"Description",[142,154,155],{},[145,156,157],{},"Example",[159,160,161,177,192,207,222,237,252,267,282,297,312,327,342],"tbody",{},[139,162,163,169,172],{},[164,165,166],"td",{},[52,167,168],{},"content",[164,170,171],{},"Defines the content of the PDF (text, tables, images, etc.).",[164,173,174],{},[52,175,176],{},"{ \"content\": \"Hello, World!\" }",[139,178,179,184,187],{},[164,180,181],{},[52,182,183],{},"style",[164,185,186],{},"Specifies the style for content (font size, font family, etc.).",[164,188,189],{},[52,190,191],{},"{ \"style\": \"headerStyle\" }",[139,193,194,199,202],{},[164,195,196],{},[52,197,198],{},"layout",[164,200,201],{},"Defines the layout of a table (e.g., 'lightHorizontalLines', 'noBorders').",[164,203,204],{},[52,205,206],{},"{ \"layout\": \"lightHorizontalLines\" }",[139,208,209,214,217],{},[164,210,211],{},[52,212,213],{},"pageSize",[164,215,216],{},"Defines the page size for the PDF.",[164,218,219],{},[52,220,221],{},"{ \"pageSize\": \"A4\" }",[139,223,224,229,232],{},[164,225,226],{},[52,227,228],{},"pageMargins",[164,230,231],{},"Sets the margins for the PDF (left, top, right, bottom).",[164,233,234],{},[52,235,236],{},"{ \"pageMargins\": [40, 60, 40, 60] }",[139,238,239,244,247],{},[164,240,241],{},[52,242,243],{},"header",[164,245,246],{},"Specifies a header for the PDF. Can be a static text or dynamic content.",[164,248,249],{},[52,250,251],{},"{ \"header\": \"My PDF Report\" }",[139,253,254,259,262],{},[164,255,256],{},[52,257,258],{},"footer",[164,260,261],{},"Specifies a footer for the PDF. Can be a static text or dynamic content.",[164,263,264],{},[52,265,266],{},"{ \"footer\": \"Page {PAGE_NUM} of {PAGE_COUNT}\" }",[139,268,269,274,277],{},[164,270,271],{},[52,272,273],{},"defaultStyle",[164,275,276],{},"Defines the default style for all content in the PDF.",[164,278,279],{},[52,280,281],{},"{ \"defaultStyle\": { \"font\": \"Helvetica\", \"fontSize\": 12 } }",[139,283,284,289,292],{},[164,285,286],{},[52,287,288],{},"background",[164,290,291],{},"Adds a background to the page or content area.",[164,293,294],{},[52,295,296],{},"{ \"background\": { \"image\": \"imageData\" } }",[139,298,299,304,307],{},[164,300,301],{},[52,302,303],{},"width",[164,305,306],{},"Sets the width of table cells or other elements.",[164,308,309],{},[52,310,311],{},"{ \"width\": 150 }",[139,313,314,319,322],{},[164,315,316],{},[52,317,318],{},"height",[164,320,321],{},"Sets the height of table cells or other elements.",[164,323,324],{},[52,325,326],{},"{ \"height\": 50 }",[139,328,329,334,337],{},[164,330,331],{},[52,332,333],{},"alignment",[164,335,336],{},"Specifies the text alignment (left, center, right).",[164,338,339],{},[52,340,341],{},"{ \"alignment\": \"center\" }",[139,343,344,349,352],{},[164,345,346],{},[52,347,348],{},"border",[164,350,351],{},"Defines the border for tables or table cells (style, width, and color).",[164,353,354],{},[52,355,356],{},"{ \"border\": [true, true, true, true] }",[10,358,359,360,365],{},"For additional attributes and information, refer to the ",[32,361,364],{"href":362,"rel":363},"https:\u002F\u002Fpdfmake.github.io\u002Fdocs\u002F0.1\u002Fdocument-definition-object\u002F",[36],"pdfmake documentation",", as pdfbuilder-node uses this library to generate PDFs.",[10,367,368],{},"Here’s a simple example of how you can use these attributes to create a basic PDF:",[370,371,376],"pre",{"className":372,"code":373,"language":374,"meta":375,"style":375},"language-json shiki shiki-themes github-light github-dark","{\n  \"content\": [\n    {\n      \"svg\": \"logoDataHere\",\n      \"width\": 150,\n      \"alignment\": \"center\",\n      \"margin\": [0, 0, 0, 20]\n    },\n    {\n      \"text\": \"Production Report - 2025\",\n      \"style\": \"header\"\n    },\n    {\n      \"text\": \"Daily Production Summary with Operator Performance\",\n      \"style\": \"subheader\",\n      \"alignment\": \"center\",\n      \"margin\": [0, 10, 0, 20]\n    },\n    {\n      \"layout\": \"lightHorizontalLines\",\n      \"table\": {\n        \"headerRows\": 1,\n        \"widths\": [\"auto\", \"auto\", \"*\", \"auto\", \"auto\", \"*\"],\n        \"body\": [\n          [\"Date\", \"Shift\", \"Product\", \"Units Produced\", \"Defective Units\", \"Operator\"],\n          [\"2025-01-01\", \"Morning\", \"Product A\", \"1000\", \"20\", \"John Doe\"],\n          [\"2025-01-01\", \"Afternoon\", \"Product B\", \"950\", \"15\", \"Jane Smith\"],\n          [\"2025-01-02\", \"Morning\", \"Product A\", \"1050\", \"10\", \"James Brown\"],\n          [\"2025-01-02\", \"Afternoon\", \"Product C\", \"800\", \"30\", \"Emily Clark\"],\n          [\"2025-01-03\", \"Morning\", \"Product B\", \"1100\", \"25\", \"Michael Green\"],\n          [\"2025-01-03\", \"Afternoon\", \"Product A\", \"980\", \"18\", \"Sarah White\"]\n        ]\n      }\n    },\n    {\n      \"text\": \"This table summarizes the daily production output across different shifts and operators. It includes total units produced and defective units recorded for quality analysis.\",\n      \"fontSize\": 12,\n      \"alignment\": \"justify\",\n      \"margin\": [0, 10, 0, 20]\n    },\n    {\n      \"text\": \"Internal Use Only - Manufacturing Co.\",\n      \"style\": \"footer\",\n      \"alignment\": \"center\",\n      \"margin\": [0, 20, 0, 0]\n    }\n  ],\n  \"styles\": {\n    \"header\": {\n      \"fontSize\": 20,\n      \"bold\": true,\n      \"alignment\": \"center\",\n      \"margin\": [0, 20, 0, 10]\n    },\n    \"subheader\": {\n      \"fontSize\": 14,\n      \"italics\": true,\n      \"color\": \"grey\",\n      \"margin\": [0, 10, 0, 20]\n    },\n    \"footer\": {\n      \"fontSize\": 10,\n      \"color\": \"grey\"\n    }\n  },\n  \"pageSize\": \"A4\",\n  \"pageMargins\": [40, 60, 40, 60]\n}\n","json","",[52,377,378,387,397,403,419,432,445,473,479,484,497,508,513,518,530,542,553,577,582,587,600,609,622,657,665,701,736,770,803,836,869,901,907,913,918,923,935,948,960,983,988,993,1005,1017,1028,1051,1057,1063,1071,1079,1090,1103,1114,1137,1142,1150,1162,1174,1187,1210,1215,1223,1234,1244,1249,1255,1268,1294],{"__ignoreMap":375},[379,380,383],"span",{"class":381,"line":382},"line",1,[379,384,386],{"class":385},"sVt8B","{\n",[379,388,390,394],{"class":381,"line":389},2,[379,391,393],{"class":392},"sj4cs","  \"content\"",[379,395,396],{"class":385},": [\n",[379,398,400],{"class":381,"line":399},3,[379,401,402],{"class":385},"    {\n",[379,404,406,409,412,416],{"class":381,"line":405},4,[379,407,408],{"class":392},"      \"svg\"",[379,410,411],{"class":385},": ",[379,413,415],{"class":414},"sZZnC","\"logoDataHere\"",[379,417,418],{"class":385},",\n",[379,420,422,425,427,430],{"class":381,"line":421},5,[379,423,424],{"class":392},"      \"width\"",[379,426,411],{"class":385},[379,428,429],{"class":392},"150",[379,431,418],{"class":385},[379,433,435,438,440,443],{"class":381,"line":434},6,[379,436,437],{"class":392},"      \"alignment\"",[379,439,411],{"class":385},[379,441,442],{"class":414},"\"center\"",[379,444,418],{"class":385},[379,446,448,451,454,457,459,461,463,465,467,470],{"class":381,"line":447},7,[379,449,450],{"class":392},"      \"margin\"",[379,452,453],{"class":385},": [",[379,455,456],{"class":392},"0",[379,458,113],{"class":385},[379,460,456],{"class":392},[379,462,113],{"class":385},[379,464,456],{"class":392},[379,466,113],{"class":385},[379,468,469],{"class":392},"20",[379,471,472],{"class":385},"]\n",[379,474,476],{"class":381,"line":475},8,[379,477,478],{"class":385},"    },\n",[379,480,482],{"class":381,"line":481},9,[379,483,402],{"class":385},[379,485,487,490,492,495],{"class":381,"line":486},10,[379,488,489],{"class":392},"      \"text\"",[379,491,411],{"class":385},[379,493,494],{"class":414},"\"Production Report - 2025\"",[379,496,418],{"class":385},[379,498,500,503,505],{"class":381,"line":499},11,[379,501,502],{"class":392},"      \"style\"",[379,504,411],{"class":385},[379,506,507],{"class":414},"\"header\"\n",[379,509,511],{"class":381,"line":510},12,[379,512,478],{"class":385},[379,514,516],{"class":381,"line":515},13,[379,517,402],{"class":385},[379,519,521,523,525,528],{"class":381,"line":520},14,[379,522,489],{"class":392},[379,524,411],{"class":385},[379,526,527],{"class":414},"\"Daily Production Summary with Operator Performance\"",[379,529,418],{"class":385},[379,531,533,535,537,540],{"class":381,"line":532},15,[379,534,502],{"class":392},[379,536,411],{"class":385},[379,538,539],{"class":414},"\"subheader\"",[379,541,418],{"class":385},[379,543,545,547,549,551],{"class":381,"line":544},16,[379,546,437],{"class":392},[379,548,411],{"class":385},[379,550,442],{"class":414},[379,552,418],{"class":385},[379,554,556,558,560,562,564,567,569,571,573,575],{"class":381,"line":555},17,[379,557,450],{"class":392},[379,559,453],{"class":385},[379,561,456],{"class":392},[379,563,113],{"class":385},[379,565,566],{"class":392},"10",[379,568,113],{"class":385},[379,570,456],{"class":392},[379,572,113],{"class":385},[379,574,469],{"class":392},[379,576,472],{"class":385},[379,578,580],{"class":381,"line":579},18,[379,581,478],{"class":385},[379,583,585],{"class":381,"line":584},19,[379,586,402],{"class":385},[379,588,590,593,595,598],{"class":381,"line":589},20,[379,591,592],{"class":392},"      \"layout\"",[379,594,411],{"class":385},[379,596,597],{"class":414},"\"lightHorizontalLines\"",[379,599,418],{"class":385},[379,601,603,606],{"class":381,"line":602},21,[379,604,605],{"class":392},"      \"table\"",[379,607,608],{"class":385},": {\n",[379,610,612,615,617,620],{"class":381,"line":611},22,[379,613,614],{"class":392},"        \"headerRows\"",[379,616,411],{"class":385},[379,618,619],{"class":392},"1",[379,621,418],{"class":385},[379,623,625,628,630,633,635,637,639,642,644,646,648,650,652,654],{"class":381,"line":624},23,[379,626,627],{"class":392},"        \"widths\"",[379,629,453],{"class":385},[379,631,632],{"class":414},"\"auto\"",[379,634,113],{"class":385},[379,636,632],{"class":414},[379,638,113],{"class":385},[379,640,641],{"class":414},"\"*\"",[379,643,113],{"class":385},[379,645,632],{"class":414},[379,647,113],{"class":385},[379,649,632],{"class":414},[379,651,113],{"class":385},[379,653,641],{"class":414},[379,655,656],{"class":385},"],\n",[379,658,660,663],{"class":381,"line":659},24,[379,661,662],{"class":392},"        \"body\"",[379,664,396],{"class":385},[379,666,668,671,674,676,679,681,684,686,689,691,694,696,699],{"class":381,"line":667},25,[379,669,670],{"class":385},"          [",[379,672,673],{"class":414},"\"Date\"",[379,675,113],{"class":385},[379,677,678],{"class":414},"\"Shift\"",[379,680,113],{"class":385},[379,682,683],{"class":414},"\"Product\"",[379,685,113],{"class":385},[379,687,688],{"class":414},"\"Units Produced\"",[379,690,113],{"class":385},[379,692,693],{"class":414},"\"Defective Units\"",[379,695,113],{"class":385},[379,697,698],{"class":414},"\"Operator\"",[379,700,656],{"class":385},[379,702,704,706,709,711,714,716,719,721,724,726,729,731,734],{"class":381,"line":703},26,[379,705,670],{"class":385},[379,707,708],{"class":414},"\"2025-01-01\"",[379,710,113],{"class":385},[379,712,713],{"class":414},"\"Morning\"",[379,715,113],{"class":385},[379,717,718],{"class":414},"\"Product A\"",[379,720,113],{"class":385},[379,722,723],{"class":414},"\"1000\"",[379,725,113],{"class":385},[379,727,728],{"class":414},"\"20\"",[379,730,113],{"class":385},[379,732,733],{"class":414},"\"John Doe\"",[379,735,656],{"class":385},[379,737,739,741,743,745,748,750,753,755,758,760,763,765,768],{"class":381,"line":738},27,[379,740,670],{"class":385},[379,742,708],{"class":414},[379,744,113],{"class":385},[379,746,747],{"class":414},"\"Afternoon\"",[379,749,113],{"class":385},[379,751,752],{"class":414},"\"Product B\"",[379,754,113],{"class":385},[379,756,757],{"class":414},"\"950\"",[379,759,113],{"class":385},[379,761,762],{"class":414},"\"15\"",[379,764,113],{"class":385},[379,766,767],{"class":414},"\"Jane Smith\"",[379,769,656],{"class":385},[379,771,773,775,778,780,782,784,786,788,791,793,796,798,801],{"class":381,"line":772},28,[379,774,670],{"class":385},[379,776,777],{"class":414},"\"2025-01-02\"",[379,779,113],{"class":385},[379,781,713],{"class":414},[379,783,113],{"class":385},[379,785,718],{"class":414},[379,787,113],{"class":385},[379,789,790],{"class":414},"\"1050\"",[379,792,113],{"class":385},[379,794,795],{"class":414},"\"10\"",[379,797,113],{"class":385},[379,799,800],{"class":414},"\"James Brown\"",[379,802,656],{"class":385},[379,804,806,808,810,812,814,816,819,821,824,826,829,831,834],{"class":381,"line":805},29,[379,807,670],{"class":385},[379,809,777],{"class":414},[379,811,113],{"class":385},[379,813,747],{"class":414},[379,815,113],{"class":385},[379,817,818],{"class":414},"\"Product C\"",[379,820,113],{"class":385},[379,822,823],{"class":414},"\"800\"",[379,825,113],{"class":385},[379,827,828],{"class":414},"\"30\"",[379,830,113],{"class":385},[379,832,833],{"class":414},"\"Emily Clark\"",[379,835,656],{"class":385},[379,837,839,841,844,846,848,850,852,854,857,859,862,864,867],{"class":381,"line":838},30,[379,840,670],{"class":385},[379,842,843],{"class":414},"\"2025-01-03\"",[379,845,113],{"class":385},[379,847,713],{"class":414},[379,849,113],{"class":385},[379,851,752],{"class":414},[379,853,113],{"class":385},[379,855,856],{"class":414},"\"1100\"",[379,858,113],{"class":385},[379,860,861],{"class":414},"\"25\"",[379,863,113],{"class":385},[379,865,866],{"class":414},"\"Michael Green\"",[379,868,656],{"class":385},[379,870,872,874,876,878,880,882,884,886,889,891,894,896,899],{"class":381,"line":871},31,[379,873,670],{"class":385},[379,875,843],{"class":414},[379,877,113],{"class":385},[379,879,747],{"class":414},[379,881,113],{"class":385},[379,883,718],{"class":414},[379,885,113],{"class":385},[379,887,888],{"class":414},"\"980\"",[379,890,113],{"class":385},[379,892,893],{"class":414},"\"18\"",[379,895,113],{"class":385},[379,897,898],{"class":414},"\"Sarah White\"",[379,900,472],{"class":385},[379,902,904],{"class":381,"line":903},32,[379,905,906],{"class":385},"        ]\n",[379,908,910],{"class":381,"line":909},33,[379,911,912],{"class":385},"      }\n",[379,914,916],{"class":381,"line":915},34,[379,917,478],{"class":385},[379,919,921],{"class":381,"line":920},35,[379,922,402],{"class":385},[379,924,926,928,930,933],{"class":381,"line":925},36,[379,927,489],{"class":392},[379,929,411],{"class":385},[379,931,932],{"class":414},"\"This table summarizes the daily production output across different shifts and operators. It includes total units produced and defective units recorded for quality analysis.\"",[379,934,418],{"class":385},[379,936,938,941,943,946],{"class":381,"line":937},37,[379,939,940],{"class":392},"      \"fontSize\"",[379,942,411],{"class":385},[379,944,945],{"class":392},"12",[379,947,418],{"class":385},[379,949,951,953,955,958],{"class":381,"line":950},38,[379,952,437],{"class":392},[379,954,411],{"class":385},[379,956,957],{"class":414},"\"justify\"",[379,959,418],{"class":385},[379,961,963,965,967,969,971,973,975,977,979,981],{"class":381,"line":962},39,[379,964,450],{"class":392},[379,966,453],{"class":385},[379,968,456],{"class":392},[379,970,113],{"class":385},[379,972,566],{"class":392},[379,974,113],{"class":385},[379,976,456],{"class":392},[379,978,113],{"class":385},[379,980,469],{"class":392},[379,982,472],{"class":385},[379,984,986],{"class":381,"line":985},40,[379,987,478],{"class":385},[379,989,991],{"class":381,"line":990},41,[379,992,402],{"class":385},[379,994,996,998,1000,1003],{"class":381,"line":995},42,[379,997,489],{"class":392},[379,999,411],{"class":385},[379,1001,1002],{"class":414},"\"Internal Use Only - Manufacturing Co.\"",[379,1004,418],{"class":385},[379,1006,1008,1010,1012,1015],{"class":381,"line":1007},43,[379,1009,502],{"class":392},[379,1011,411],{"class":385},[379,1013,1014],{"class":414},"\"footer\"",[379,1016,418],{"class":385},[379,1018,1020,1022,1024,1026],{"class":381,"line":1019},44,[379,1021,437],{"class":392},[379,1023,411],{"class":385},[379,1025,442],{"class":414},[379,1027,418],{"class":385},[379,1029,1031,1033,1035,1037,1039,1041,1043,1045,1047,1049],{"class":381,"line":1030},45,[379,1032,450],{"class":392},[379,1034,453],{"class":385},[379,1036,456],{"class":392},[379,1038,113],{"class":385},[379,1040,469],{"class":392},[379,1042,113],{"class":385},[379,1044,456],{"class":392},[379,1046,113],{"class":385},[379,1048,456],{"class":392},[379,1050,472],{"class":385},[379,1052,1054],{"class":381,"line":1053},46,[379,1055,1056],{"class":385},"    }\n",[379,1058,1060],{"class":381,"line":1059},47,[379,1061,1062],{"class":385},"  ],\n",[379,1064,1066,1069],{"class":381,"line":1065},48,[379,1067,1068],{"class":392},"  \"styles\"",[379,1070,608],{"class":385},[379,1072,1074,1077],{"class":381,"line":1073},49,[379,1075,1076],{"class":392},"    \"header\"",[379,1078,608],{"class":385},[379,1080,1082,1084,1086,1088],{"class":381,"line":1081},50,[379,1083,940],{"class":392},[379,1085,411],{"class":385},[379,1087,469],{"class":392},[379,1089,418],{"class":385},[379,1091,1093,1096,1098,1101],{"class":381,"line":1092},51,[379,1094,1095],{"class":392},"      \"bold\"",[379,1097,411],{"class":385},[379,1099,1100],{"class":392},"true",[379,1102,418],{"class":385},[379,1104,1106,1108,1110,1112],{"class":381,"line":1105},52,[379,1107,437],{"class":392},[379,1109,411],{"class":385},[379,1111,442],{"class":414},[379,1113,418],{"class":385},[379,1115,1117,1119,1121,1123,1125,1127,1129,1131,1133,1135],{"class":381,"line":1116},53,[379,1118,450],{"class":392},[379,1120,453],{"class":385},[379,1122,456],{"class":392},[379,1124,113],{"class":385},[379,1126,469],{"class":392},[379,1128,113],{"class":385},[379,1130,456],{"class":392},[379,1132,113],{"class":385},[379,1134,566],{"class":392},[379,1136,472],{"class":385},[379,1138,1140],{"class":381,"line":1139},54,[379,1141,478],{"class":385},[379,1143,1145,1148],{"class":381,"line":1144},55,[379,1146,1147],{"class":392},"    \"subheader\"",[379,1149,608],{"class":385},[379,1151,1153,1155,1157,1160],{"class":381,"line":1152},56,[379,1154,940],{"class":392},[379,1156,411],{"class":385},[379,1158,1159],{"class":392},"14",[379,1161,418],{"class":385},[379,1163,1165,1168,1170,1172],{"class":381,"line":1164},57,[379,1166,1167],{"class":392},"      \"italics\"",[379,1169,411],{"class":385},[379,1171,1100],{"class":392},[379,1173,418],{"class":385},[379,1175,1177,1180,1182,1185],{"class":381,"line":1176},58,[379,1178,1179],{"class":392},"      \"color\"",[379,1181,411],{"class":385},[379,1183,1184],{"class":414},"\"grey\"",[379,1186,418],{"class":385},[379,1188,1190,1192,1194,1196,1198,1200,1202,1204,1206,1208],{"class":381,"line":1189},59,[379,1191,450],{"class":392},[379,1193,453],{"class":385},[379,1195,456],{"class":392},[379,1197,113],{"class":385},[379,1199,566],{"class":392},[379,1201,113],{"class":385},[379,1203,456],{"class":392},[379,1205,113],{"class":385},[379,1207,469],{"class":392},[379,1209,472],{"class":385},[379,1211,1213],{"class":381,"line":1212},60,[379,1214,478],{"class":385},[379,1216,1218,1221],{"class":381,"line":1217},61,[379,1219,1220],{"class":392},"    \"footer\"",[379,1222,608],{"class":385},[379,1224,1226,1228,1230,1232],{"class":381,"line":1225},62,[379,1227,940],{"class":392},[379,1229,411],{"class":385},[379,1231,566],{"class":392},[379,1233,418],{"class":385},[379,1235,1237,1239,1241],{"class":381,"line":1236},63,[379,1238,1179],{"class":392},[379,1240,411],{"class":385},[379,1242,1243],{"class":414},"\"grey\"\n",[379,1245,1247],{"class":381,"line":1246},64,[379,1248,1056],{"class":385},[379,1250,1252],{"class":381,"line":1251},65,[379,1253,1254],{"class":385},"  },\n",[379,1256,1258,1261,1263,1266],{"class":381,"line":1257},66,[379,1259,1260],{"class":392},"  \"pageSize\"",[379,1262,411],{"class":385},[379,1264,1265],{"class":414},"\"A4\"",[379,1267,418],{"class":385},[379,1269,1271,1274,1276,1279,1281,1284,1286,1288,1290,1292],{"class":381,"line":1270},67,[379,1272,1273],{"class":392},"  \"pageMargins\"",[379,1275,453],{"class":385},[379,1277,1278],{"class":392},"40",[379,1280,113],{"class":385},[379,1282,1283],{"class":392},"60",[379,1285,113],{"class":385},[379,1287,1278],{"class":392},[379,1289,113],{"class":385},[379,1291,1283],{"class":392},[379,1293,472],{"class":385},[379,1295,1297],{"class":381,"line":1296},68,[379,1298,1299],{"class":385},"}\n",[10,1301,1302],{},"This example creates a simple PDF featuring a centered logo, a title, a subtitle, a table with a light horizontal line layout, a paragraph of text, and a footer at the end. The following screenshot shows how it looks. You can customize it by adjusting the styles, layout, and content.",[10,1304,1305,1310],{},[1306,1307],"img",{"alt":1308,"dataZoomable":375,"src":1309},"Example pdf result","\u002Fblog\u002F2025\u002F05\u002Fimages\u002Fexample-pdf.png",[1311,1312,1308],"em",{},[72,1314,1316],{"id":1315},"step-3:-creating-a-flow-to-generate-a-pdf","Step 3: Creating a Flow to Generate a PDF",[10,1318,1319],{},"Let's learn how to generate a PDF using dynamic inputs. For this, we’ll use the same example PDF report shown earlier—but this time, we’ll replace the hardcoded values with dynamic input data.",[86,1321,1322],{},[28,1323,1324],{},"For this guide's practical example, we will use the following SQLite flow that generates simulated production data. If you don't have the data source, you can import the flow below to follow along. After importing, deploy the flow and click the Inject node button to generate and insert the data.",[10,1326,1327],{},"When generating PDFs for your specific data, start by creating a flow to collect the information you want in the report. This data can come from sensors, databases, APIs, or even manual inputs.",[1329,1330],"render-flow",{":height":1331,"flow":1332},"300","W3siaWQiOiIxZTczZmVmNzE4YmI0ODc2IiwidHlwZSI6Imdyb3VwIiwieiI6ImIzNzQyODY5NGU5MGIyYzUiLCJzdHlsZSI6eyJzdHJva2UiOiIjYjJiM2JkIiwic3Ryb2tlLW9wYWNpdHkiOiIxIiwiZmlsbCI6IiNmMmYzZmIiLCJmaWxsLW9wYWNpdHkiOiIwLjUiLCJsYWJlbCI6dHJ1ZSwibGFiZWwtcG9zaXRpb24iOiJudyIsImNvbG9yIjoiIzMyMzMzYiJ9LCJub2RlcyI6WyI1MTY5Yjk2YWQ2NmRjZmY2IiwiYjc1ZmRlMzdlYTQzMWQ4NCIsImE1NzFiYmQ3YjBjMGNiMjUiXSwieCI6MTQsInkiOjU5LCJ3Ijo4MTIsImgiOjgyfSx7ImlkIjoiNTE2OWI5NmFkNjZkY2ZmNiIsInR5cGUiOiJpbmplY3QiLCJ6IjoiYjM3NDI4Njk0ZTkwYjJjNSIsImciOiIxZTczZmVmNzE4YmI0ODc2IiwibmFtZSI6IkNyZWF0ZSBUYWJsZSIsInByb3BzIjpbeyJwIjoicGF5bG9hZCJ9LHsicCI6InRvcGljIiwidnQiOiJzdH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oic2V0IiwicCI6InBhcmFtcy4kZGVmZWN0aXZlX3VuaXRzIiwicHQiOiJtc2ciLCJ0byI6InBheWxvYWQuZGVmZWN0aXZlX3VuaXRzIiwidG90IjoibXNnIn0seyJ0Ijoic2V0IiwicCI6InBhcmFtcy4kb3BlcmF0b3IiLCJwdCI6Im1zZyIsInRvIjoicGF5bG9hZC5vcGVyYXRvciIsInRvdCI6Im1zZyJ9XSwiYWN0aW9uIjoiIiwicHJvcGVydHkiOiIiLCJmcm9tIjoiIiwidG8iOiIiLCJyZWciOmZhbHNlLCJ4Ijo4NjAsInkiOjIyMCwid2lyZXMiOltbIjE5YWQwOGQzMDE1ZWY4ZjIiXV19LHsiaWQiOiIyZGYzMzhlMThjOWE2MGQ1IiwidHlwZSI6ImRlYnVnIiwieiI6ImIzNzQyODY5NGU5MGIyYzUiLCJnIjoiY2NjYTc4MTBjNmIzZGI0MSIsIm5hbWUiOiJkZWJ1ZyAzIiwiYWN0aXZlIjp0cnVlLCJ0b3NpZGViYXIiOnRydWUsImNvbnNvbGUiOmZhbHNlLCJ0b3N0YXR1cyI6ZmFsc2UsImNvbXBsZXRlIjoiZmFsc2UiLCJzdGF0dXNWYWwiOiIiLCJzdGF0dXNUeXBlIjoiYXV0byIsIngiOjEyNDAsInkiOjIyMCwid2lyZXMiOltdfV0=",[86,1334,1335,1342],{"start":389},[28,1336,1337,1338,1341],{},"Drag an ",[145,1339,1340],{},"Inject"," node onto the canvas.",[28,1343,1337,1344,1347,1348,1350],{},[145,1345,1346],{},"SQLite"," node and connect it to the Inject node. Configure the ",[145,1349,1346],{}," node with the same database to generate the simulated data. Set the SQL Query type to \"fixed statement\" and use the following query:",[370,1352,1356],{"className":1353,"code":1354,"language":1355,"meta":375,"style":375},"language-sql shiki shiki-themes github-light github-dark","SELECT * FROM production_report;\n","sql",[52,1357,1358],{"__ignoreMap":375},[379,1359,1360],{"class":381,"line":382},[379,1361,1354],{},[86,1363,1364],{"start":405},[28,1365,1366,1367,1370],{},"Drag a ",[145,1368,1369],{},"Function"," node onto the canvas and paste the following JavaScript code. When generating PDFs for your specific data, make sure to adjust the code to match your data structure.",[370,1372,1376],{"className":1373,"code":1374,"language":1375,"meta":375,"style":375},"language-javascript shiki shiki-themes github-light github-dark","\u002F\u002F Initialize table body with headers\nconst tableBody = [\n    ['Date', 'Shift', 'Product', 'Units Produced', 'Defective Units', 'Operator']\n];\n\nconst logo = `\u003Creplace-this-your-logo-svg`\n\n\u002F\u002F Loop through data rows from SQLite (msg.payload)\nfor (const row of msg.payload) {\n    tableBody.push([\n        row.date,\n        row.shift,\n        row.product,\n        row.units_produced.toString(),\n        row.defective_units.toString(),\n        row.operator\n    ]);\n}\n\nconst docDefinition = {\n    content: [\n        {\n            svg: logo,\n            width: 150, \u002F\u002F Adjust the logo size as needed\n            alignment: 'center',\n            margin: [0, 0, 0, 20]\n        },\n        \u002F\u002F Header\n        {\n            text: 'Production Report - 2025',\n            style: 'header'\n        },\n\n        \u002F\u002F Subheader\n        {\n            text: 'Daily Production Summary with Operator Performance',\n            style: 'subheader',\n            alignment: 'center',\n            margin: [0, 10, 0, 20]\n        },\n\n        \u002F\u002F Table\n        {\n            layout: 'lightHorizontalLines',\n            table: {\n                headerRows: 1,\n                widths: ['auto', 'auto', '*', 'auto', 'auto', '*'],\n                body: tableBody\n            }\n        },\n\n        \u002F\u002F Description\n        {\n            text: 'This table summarizes the daily production output across different shifts and operators. It includes total units produced and defective units recorded for quality analysis.',\n            fontSize: 12,\n            alignment: 'justify',\n            margin: [0, 10, 0, 20]\n        },\n\n        \u002F\u002F Footer\n        {\n            text: 'Internal Use Only - Manufacturing Co.',\n            style: 'footer',\n            alignment: 'center',\n            margin: [0, 20, 0, 0]\n        }\n    ],\n\n    styles: {\n        header: {\n            fontSize: 20,\n            bold: true,\n            alignment: 'center',\n            margin: [0, 20, 0, 10]\n        },\n        subheader: {\n            fontSize: 14,\n            italics: true,\n            color: 'grey',\n            margin: [0, 10, 0, 20]\n        },\n        footer: {\n            fontSize: 10,\n            color: 'grey'\n        }\n    },\n\n    pageSize: 'A4',\n    pageMargins: [40, 60, 40, 60]\n};\n\nmsg.payload = docDefinition;\nreturn msg;\n","javascript",[52,1377,1378,1384,1399,1434,1439,1445,1457,1461,1466,1485,1497,1502,1507,1512,1523,1532,1537,1542,1546,1550,1562,1567,1572,1577,1589,1599,1620,1625,1630,1634,1644,1652,1656,1660,1665,1669,1678,1687,1695,1715,1719,1723,1728,1732,1742,1747,1756,1787,1792,1797,1801,1805,1810,1814,1823,1832,1841,1861,1865,1869,1874,1878,1887,1896,1904,1924,1929,1934,1938,1944,1950,1959,1969,1978,1999,2004,2010,2019,2029,2040,2061,2066,2072,2081,2089,2094,2099,2104,2115,2137,2143,2148,2160],{"__ignoreMap":375},[379,1379,1380],{"class":381,"line":382},[379,1381,1383],{"class":1382},"sJ8bj","\u002F\u002F Initialize table body with headers\n",[379,1385,1386,1390,1393,1396],{"class":381,"line":389},[379,1387,1389],{"class":1388},"szBVR","const",[379,1391,1392],{"class":392}," tableBody",[379,1394,1395],{"class":1388}," =",[379,1397,1398],{"class":385}," [\n",[379,1400,1401,1404,1407,1409,1412,1414,1417,1419,1422,1424,1427,1429,1432],{"class":381,"line":399},[379,1402,1403],{"class":385},"    [",[379,1405,1406],{"class":414},"'Date'",[379,1408,113],{"class":385},[379,1410,1411],{"class":414},"'Shift'",[379,1413,113],{"class":385},[379,1415,1416],{"class":414},"'Product'",[379,1418,113],{"class":385},[379,1420,1421],{"class":414},"'Units Produced'",[379,1423,113],{"class":385},[379,1425,1426],{"class":414},"'Defective Units'",[379,1428,113],{"class":385},[379,1430,1431],{"class":414},"'Operator'",[379,1433,472],{"class":385},[379,1435,1436],{"class":381,"line":405},[379,1437,1438],{"class":385},"];\n",[379,1440,1441],{"class":381,"line":421},[379,1442,1444],{"emptyLinePlaceholder":1443},true,"\n",[379,1446,1447,1449,1452,1454],{"class":381,"line":434},[379,1448,1389],{"class":1388},[379,1450,1451],{"class":392}," logo",[379,1453,1395],{"class":1388},[379,1455,1456],{"class":414}," `\u003Creplace-this-your-logo-svg`\n",[379,1458,1459],{"class":381,"line":447},[379,1460,1444],{"emptyLinePlaceholder":1443},[379,1462,1463],{"class":381,"line":475},[379,1464,1465],{"class":1382},"\u002F\u002F Loop through data rows from SQLite (msg.payload)\n",[379,1467,1468,1471,1474,1476,1479,1482],{"class":381,"line":481},[379,1469,1470],{"class":1388},"for",[379,1472,1473],{"class":385}," (",[379,1475,1389],{"class":1388},[379,1477,1478],{"class":392}," row",[379,1480,1481],{"class":1388}," of",[379,1483,1484],{"class":385}," msg.payload) {\n",[379,1486,1487,1490,1494],{"class":381,"line":486},[379,1488,1489],{"class":385},"    tableBody.",[379,1491,1493],{"class":1492},"sScJk","push",[379,1495,1496],{"class":385},"([\n",[379,1498,1499],{"class":381,"line":499},[379,1500,1501],{"class":385},"        row.date,\n",[379,1503,1504],{"class":381,"line":510},[379,1505,1506],{"class":385},"        row.shift,\n",[379,1508,1509],{"class":381,"line":515},[379,1510,1511],{"class":385},"        row.product,\n",[379,1513,1514,1517,1520],{"class":381,"line":520},[379,1515,1516],{"class":385},"        row.units_produced.",[379,1518,1519],{"class":1492},"toString",[379,1521,1522],{"class":385},"(),\n",[379,1524,1525,1528,1530],{"class":381,"line":532},[379,1526,1527],{"class":385},"        row.defective_units.",[379,1529,1519],{"class":1492},[379,1531,1522],{"class":385},[379,1533,1534],{"class":381,"line":544},[379,1535,1536],{"class":385},"        row.operator\n",[379,1538,1539],{"class":381,"line":555},[379,1540,1541],{"class":385},"    ]);\n",[379,1543,1544],{"class":381,"line":579},[379,1545,1299],{"class":385},[379,1547,1548],{"class":381,"line":584},[379,1549,1444],{"emptyLinePlaceholder":1443},[379,1551,1552,1554,1557,1559],{"class":381,"line":589},[379,1553,1389],{"class":1388},[379,1555,1556],{"class":392}," docDefinition",[379,1558,1395],{"class":1388},[379,1560,1561],{"class":385}," {\n",[379,1563,1564],{"class":381,"line":602},[379,1565,1566],{"class":385},"    content: [\n",[379,1568,1569],{"class":381,"line":611},[379,1570,1571],{"class":385},"        {\n",[379,1573,1574],{"class":381,"line":624},[379,1575,1576],{"class":385},"            svg: logo,\n",[379,1578,1579,1582,1584,1586],{"class":381,"line":659},[379,1580,1581],{"class":385},"            width: ",[379,1583,429],{"class":392},[379,1585,113],{"class":385},[379,1587,1588],{"class":1382},"\u002F\u002F Adjust the logo size as needed\n",[379,1590,1591,1594,1597],{"class":381,"line":667},[379,1592,1593],{"class":385},"            alignment: ",[379,1595,1596],{"class":414},"'center'",[379,1598,418],{"class":385},[379,1600,1601,1604,1606,1608,1610,1612,1614,1616,1618],{"class":381,"line":703},[379,1602,1603],{"class":385},"            margin: [",[379,1605,456],{"class":392},[379,1607,113],{"class":385},[379,1609,456],{"class":392},[379,1611,113],{"class":385},[379,1613,456],{"class":392},[379,1615,113],{"class":385},[379,1617,469],{"class":392},[379,1619,472],{"class":385},[379,1621,1622],{"class":381,"line":738},[379,1623,1624],{"class":385},"        },\n",[379,1626,1627],{"class":381,"line":772},[379,1628,1629],{"class":1382},"        \u002F\u002F Header\n",[379,1631,1632],{"class":381,"line":805},[379,1633,1571],{"class":385},[379,1635,1636,1639,1642],{"class":381,"line":838},[379,1637,1638],{"class":385},"            text: ",[379,1640,1641],{"class":414},"'Production Report - 2025'",[379,1643,418],{"class":385},[379,1645,1646,1649],{"class":381,"line":871},[379,1647,1648],{"class":385},"            style: ",[379,1650,1651],{"class":414},"'header'\n",[379,1653,1654],{"class":381,"line":903},[379,1655,1624],{"class":385},[379,1657,1658],{"class":381,"line":909},[379,1659,1444],{"emptyLinePlaceholder":1443},[379,1661,1662],{"class":381,"line":915},[379,1663,1664],{"class":1382},"        \u002F\u002F Subheader\n",[379,1666,1667],{"class":381,"line":920},[379,1668,1571],{"class":385},[379,1670,1671,1673,1676],{"class":381,"line":925},[379,1672,1638],{"class":385},[379,1674,1675],{"class":414},"'Daily Production Summary with Operator Performance'",[379,1677,418],{"class":385},[379,1679,1680,1682,1685],{"class":381,"line":937},[379,1681,1648],{"class":385},[379,1683,1684],{"class":414},"'subheader'",[379,1686,418],{"class":385},[379,1688,1689,1691,1693],{"class":381,"line":950},[379,1690,1593],{"class":385},[379,1692,1596],{"class":414},[379,1694,418],{"class":385},[379,1696,1697,1699,1701,1703,1705,1707,1709,1711,1713],{"class":381,"line":962},[379,1698,1603],{"class":385},[379,1700,456],{"class":392},[379,1702,113],{"class":385},[379,1704,566],{"class":392},[379,1706,113],{"class":385},[379,1708,456],{"class":392},[379,1710,113],{"class":385},[379,1712,469],{"class":392},[379,1714,472],{"class":385},[379,1716,1717],{"class":381,"line":985},[379,1718,1624],{"class":385},[379,1720,1721],{"class":381,"line":990},[379,1722,1444],{"emptyLinePlaceholder":1443},[379,1724,1725],{"class":381,"line":995},[379,1726,1727],{"class":1382},"        \u002F\u002F Table\n",[379,1729,1730],{"class":381,"line":1007},[379,1731,1571],{"class":385},[379,1733,1734,1737,1740],{"class":381,"line":1019},[379,1735,1736],{"class":385},"            layout: ",[379,1738,1739],{"class":414},"'lightHorizontalLines'",[379,1741,418],{"class":385},[379,1743,1744],{"class":381,"line":1030},[379,1745,1746],{"class":385},"            table: {\n",[379,1748,1749,1752,1754],{"class":381,"line":1053},[379,1750,1751],{"class":385},"                headerRows: ",[379,1753,619],{"class":392},[379,1755,418],{"class":385},[379,1757,1758,1761,1764,1766,1768,1770,1773,1775,1777,1779,1781,1783,1785],{"class":381,"line":1059},[379,1759,1760],{"class":385},"                widths: [",[379,1762,1763],{"class":414},"'auto'",[379,1765,113],{"class":385},[379,1767,1763],{"class":414},[379,1769,113],{"class":385},[379,1771,1772],{"class":414},"'*'",[379,1774,113],{"class":385},[379,1776,1763],{"class":414},[379,1778,113],{"class":385},[379,1780,1763],{"class":414},[379,1782,113],{"class":385},[379,1784,1772],{"class":414},[379,1786,656],{"class":385},[379,1788,1789],{"class":381,"line":1065},[379,1790,1791],{"class":385},"                body: tableBody\n",[379,1793,1794],{"class":381,"line":1073},[379,1795,1796],{"class":385},"            }\n",[379,1798,1799],{"class":381,"line":1081},[379,1800,1624],{"class":385},[379,1802,1803],{"class":381,"line":1092},[379,1804,1444],{"emptyLinePlaceholder":1443},[379,1806,1807],{"class":381,"line":1105},[379,1808,1809],{"class":1382},"        \u002F\u002F Description\n",[379,1811,1812],{"class":381,"line":1116},[379,1813,1571],{"class":385},[379,1815,1816,1818,1821],{"class":381,"line":1139},[379,1817,1638],{"class":385},[379,1819,1820],{"class":414},"'This table summarizes the daily production output across different shifts and operators. It includes total units produced and defective units recorded for quality analysis.'",[379,1822,418],{"class":385},[379,1824,1825,1828,1830],{"class":381,"line":1144},[379,1826,1827],{"class":385},"            fontSize: ",[379,1829,945],{"class":392},[379,1831,418],{"class":385},[379,1833,1834,1836,1839],{"class":381,"line":1152},[379,1835,1593],{"class":385},[379,1837,1838],{"class":414},"'justify'",[379,1840,418],{"class":385},[379,1842,1843,1845,1847,1849,1851,1853,1855,1857,1859],{"class":381,"line":1164},[379,1844,1603],{"class":385},[379,1846,456],{"class":392},[379,1848,113],{"class":385},[379,1850,566],{"class":392},[379,1852,113],{"class":385},[379,1854,456],{"class":392},[379,1856,113],{"class":385},[379,1858,469],{"class":392},[379,1860,472],{"class":385},[379,1862,1863],{"class":381,"line":1176},[379,1864,1624],{"class":385},[379,1866,1867],{"class":381,"line":1189},[379,1868,1444],{"emptyLinePlaceholder":1443},[379,1870,1871],{"class":381,"line":1212},[379,1872,1873],{"class":1382},"        \u002F\u002F Footer\n",[379,1875,1876],{"class":381,"line":1217},[379,1877,1571],{"class":385},[379,1879,1880,1882,1885],{"class":381,"line":1225},[379,1881,1638],{"class":385},[379,1883,1884],{"class":414},"'Internal Use Only - Manufacturing Co.'",[379,1886,418],{"class":385},[379,1888,1889,1891,1894],{"class":381,"line":1236},[379,1890,1648],{"class":385},[379,1892,1893],{"class":414},"'footer'",[379,1895,418],{"class":385},[379,1897,1898,1900,1902],{"class":381,"line":1246},[379,1899,1593],{"class":385},[379,1901,1596],{"class":414},[379,1903,418],{"class":385},[379,1905,1906,1908,1910,1912,1914,1916,1918,1920,1922],{"class":381,"line":1251},[379,1907,1603],{"class":385},[379,1909,456],{"class":392},[379,1911,113],{"class":385},[379,1913,469],{"class":392},[379,1915,113],{"class":385},[379,1917,456],{"class":392},[379,1919,113],{"class":385},[379,1921,456],{"class":392},[379,1923,472],{"class":385},[379,1925,1926],{"class":381,"line":1257},[379,1927,1928],{"class":385},"        }\n",[379,1930,1931],{"class":381,"line":1270},[379,1932,1933],{"class":385},"    ],\n",[379,1935,1936],{"class":381,"line":1296},[379,1937,1444],{"emptyLinePlaceholder":1443},[379,1939,1941],{"class":381,"line":1940},69,[379,1942,1943],{"class":385},"    styles: {\n",[379,1945,1947],{"class":381,"line":1946},70,[379,1948,1949],{"class":385},"        header: {\n",[379,1951,1953,1955,1957],{"class":381,"line":1952},71,[379,1954,1827],{"class":385},[379,1956,469],{"class":392},[379,1958,418],{"class":385},[379,1960,1962,1965,1967],{"class":381,"line":1961},72,[379,1963,1964],{"class":385},"            bold: ",[379,1966,1100],{"class":392},[379,1968,418],{"class":385},[379,1970,1972,1974,1976],{"class":381,"line":1971},73,[379,1973,1593],{"class":385},[379,1975,1596],{"class":414},[379,1977,418],{"class":385},[379,1979,1981,1983,1985,1987,1989,1991,1993,1995,1997],{"class":381,"line":1980},74,[379,1982,1603],{"class":385},[379,1984,456],{"class":392},[379,1986,113],{"class":385},[379,1988,469],{"class":392},[379,1990,113],{"class":385},[379,1992,456],{"class":392},[379,1994,113],{"class":385},[379,1996,566],{"class":392},[379,1998,472],{"class":385},[379,2000,2002],{"class":381,"line":2001},75,[379,2003,1624],{"class":385},[379,2005,2007],{"class":381,"line":2006},76,[379,2008,2009],{"class":385},"        subheader: {\n",[379,2011,2013,2015,2017],{"class":381,"line":2012},77,[379,2014,1827],{"class":385},[379,2016,1159],{"class":392},[379,2018,418],{"class":385},[379,2020,2022,2025,2027],{"class":381,"line":2021},78,[379,2023,2024],{"class":385},"            italics: ",[379,2026,1100],{"class":392},[379,2028,418],{"class":385},[379,2030,2032,2035,2038],{"class":381,"line":2031},79,[379,2033,2034],{"class":385},"            color: ",[379,2036,2037],{"class":414},"'grey'",[379,2039,418],{"class":385},[379,2041,2043,2045,2047,2049,2051,2053,2055,2057,2059],{"class":381,"line":2042},80,[379,2044,1603],{"class":385},[379,2046,456],{"class":392},[379,2048,113],{"class":385},[379,2050,566],{"class":392},[379,2052,113],{"class":385},[379,2054,456],{"class":392},[379,2056,113],{"class":385},[379,2058,469],{"class":392},[379,2060,472],{"class":385},[379,2062,2064],{"class":381,"line":2063},81,[379,2065,1624],{"class":385},[379,2067,2069],{"class":381,"line":2068},82,[379,2070,2071],{"class":385},"        footer: {\n",[379,2073,2075,2077,2079],{"class":381,"line":2074},83,[379,2076,1827],{"class":385},[379,2078,566],{"class":392},[379,2080,418],{"class":385},[379,2082,2084,2086],{"class":381,"line":2083},84,[379,2085,2034],{"class":385},[379,2087,2088],{"class":414},"'grey'\n",[379,2090,2092],{"class":381,"line":2091},85,[379,2093,1928],{"class":385},[379,2095,2097],{"class":381,"line":2096},86,[379,2098,478],{"class":385},[379,2100,2102],{"class":381,"line":2101},87,[379,2103,1444],{"emptyLinePlaceholder":1443},[379,2105,2107,2110,2113],{"class":381,"line":2106},88,[379,2108,2109],{"class":385},"    pageSize: ",[379,2111,2112],{"class":414},"'A4'",[379,2114,418],{"class":385},[379,2116,2118,2121,2123,2125,2127,2129,2131,2133,2135],{"class":381,"line":2117},89,[379,2119,2120],{"class":385},"    pageMargins: [",[379,2122,1278],{"class":392},[379,2124,113],{"class":385},[379,2126,1283],{"class":392},[379,2128,113],{"class":385},[379,2130,1278],{"class":392},[379,2132,113],{"class":385},[379,2134,1283],{"class":392},[379,2136,472],{"class":385},[379,2138,2140],{"class":381,"line":2139},90,[379,2141,2142],{"class":385},"};\n",[379,2144,2146],{"class":381,"line":2145},91,[379,2147,1444],{"emptyLinePlaceholder":1443},[379,2149,2151,2154,2157],{"class":381,"line":2150},92,[379,2152,2153],{"class":385},"msg.payload ",[379,2155,2156],{"class":1388},"=",[379,2158,2159],{"class":385}," docDefinition;\n",[379,2161,2163,2166],{"class":381,"line":2162},93,[379,2164,2165],{"class":1388},"return",[379,2167,2168],{"class":385}," msg;\n",[86,2170,2171,2183,2200,2215],{"start":421},[28,2172,1366,2173,2176,2177,2180,2181,100],{},[145,2174,2175],{},"pdfbuilder"," node onto the canvas. Set the input property to ",[52,2178,2179],{},"msg.payload",", set output type to Buffer, and output property to ",[52,2182,2179],{},[28,2184,1366,2185,2188,2189],{},[145,2186,2187],{},"Write File"," node, configure it with:\n",[25,2190,2191,2194,2197],{},[28,2192,2193],{},"Filename: test.pdf",[28,2195,2196],{},"Action: Overwrite file",[28,2198,2199],{},"Add newline (\\n) to each payload?: Checked",[28,2201,2202,2203,2205,2206,2208,2209,2211,2212,2214],{},"Connect the ",[145,2204,1346],{}," node to the ",[145,2207,1369],{}," node, then to the ",[145,2210,2175],{}," node, and finally to the ",[145,2213,2187],{}," node.",[28,2216,2217],{},"Deploy the flow and click inject node to generate the pdf.",[10,2219,2220,2221,2224],{},"Once the PDF is generated, you can find it in the ",[52,2222,2223],{},".node-red"," directory.",[10,2226,2227],{},"However, if you want to share the PDF with others, display it on the dashboard, and provide a download button, you can use the HTTP API, an iframe, and a few supporting nodes. Let's walk through how to do that next.",[72,2229,2231],{"id":2230},"step-4:-serving-the-pdf-via-http-and-previewing-it-on-the-dashboard","Step 4: Serving the PDF via HTTP and Previewing It on the Dashboard",[10,2233,2234],{},"In this step, we’ll make the generated PDF accessible through a web interface. You’ll be able to preview the PDF directly in the browser and embed it in your FlowFuse dashboard for a smooth, integrated experience. We’ll also add a download button so users can easily save the report. Instead of manually retrieving the file, we’ll create an HTTP endpoint to serve the PDF and use an iframe to display it.",[2236,2237,2239],"h4",{"id":2238},"exposing-the-pdf-via-http","Exposing the PDF via HTTP",[86,2241,2242,2253,2260,2332,2338],{},[28,2243,2244,2245,2248,2249,2252],{},"Drag the ",[145,2246,2247],{},"http-in"," node onto the canvas. Set the method to 'GET' and the URL to ",[52,2250,2251],{},"\u002Freport.pdf",". This will create an HTTP endpoint for retrieving the generated PDF.",[28,2254,2202,2255,2205,2257,2259],{},[145,2256,2247],{},[145,2258,1346],{}," node. This ensures that when a request is made to this endpoint, the necessary data is fetched from the database.",[28,2261,2262,2263,2265,2266,2269,2270,2272,2273,2282],{},"After the ",[145,2264,2187],{}," node in your flow, add a ",[145,2267,2268],{},"Change"," node. Connect it to the ",[145,2271,2187],{}," node, and configure it to set the following headers for the HTTP response:",[25,2274,2275],{},[28,2276,2277,2278,2281],{},"Set ",[52,2279,2280],{},"msg.headers"," to:",[370,2283,2285],{"className":372,"code":2284,"language":374,"meta":375,"style":375},"{   \n   'Content-Type': 'application\u002Fpdf',   \n   'Content-Disposition': 'inline; filename=\"report.pdf\"' \n}\n",[52,2286,2287,2292,2306,2328],{"__ignoreMap":375},[379,2288,2289],{"class":381,"line":382},[379,2290,2291],{"class":385},"{   \n",[379,2293,2294,2298,2300,2303],{"class":381,"line":389},[379,2295,2297],{"class":2296},"s7hpK","   'Content-Type'",[379,2299,411],{"class":385},[379,2301,2302],{"class":2296},"'application\u002Fpdf'",[379,2304,2305],{"class":385},",   \n",[379,2307,2308,2311,2313,2316,2319,2322,2325],{"class":381,"line":399},[379,2309,2310],{"class":2296},"   'Content-Disposition'",[379,2312,411],{"class":385},[379,2314,2315],{"class":2296},"'inline;",[379,2317,2318],{"class":2296}," filename=",[379,2320,2321],{"class":414},"\"report.pdf\"",[379,2323,2324],{"class":2296},"'",[379,2326,2327],{"class":385}," \n",[379,2329,2330],{"class":381,"line":405},[379,2331,1299],{"class":385},[28,2333,2244,2334,2337],{},[145,2335,2336],{},"HTTP-response"," node onto the canvas and connect it to the Change node.",[28,2339,2340],{},"Deploy the flow",[10,2342,2343],{},"Now, this will send the generated PDF as a response to the incoming HTTP request, allowing it to be previewed in the browser. You can check by entering the URL:",[10,2345,2346],{},[52,2347,2348],{},"https:\u002F\u002F\u003Cyour-instance-name>.flowfuse.cloud\u002Freport.pdf",[72,2350,2352],{"id":2351},"embedding-the-pdf-on-the-dashboard-and-adding-the-download-button","Embedding the PDF on the Dashboard and Adding the Download Button",[10,2354,2355],{},"Now, let's embed the PDF into the dashboard:",[86,2357,2358,2364,2389],{},[28,2359,1366,2360,2363],{},[145,2361,2362],{},"ui-event"," node onto the canvas and configure it with the appropriate UI base settings.",[28,2365,2366,2367,1341,2370,2381],{},"Next, drag an ",[145,2368,2369],{},"iframe",[25,2371,2372,2375,2378],{},[28,2373,2374],{},"Select the correct group where the PDF should be displayed.",[28,2376,2377],{},"Adjust the size according to your preferences.",[28,2379,2380],{},"In the URL field, enter:",[370,2382,2387],{"className":2383,"code":2385,"language":2386},[2384],"language-text","https:\u002F\u002F\u003Cyour-instance-name>.flowfuse.cloud\u002Freport.pdf\n","text",[52,2388,2385],{"__ignoreMap":375},[28,2390,2391],{},"Click Done and Deploy the flow.",[10,2393,2394],{},"Once deployed, when you open the dashboard, the generated PDF will be embedded and displayed directly on the dashboard page.",[10,2396,2397],{},"Now, let's add a download button:",[86,2399,2400],{"start":405},[28,2401,1366,2402,2405],{},[145,2403,2404],{},"ui-template"," widget onto the canvas and paste the following HTML code into it:",[370,2407,2411],{"className":2408,"code":2409,"language":2410,"meta":375,"style":375},"language-html shiki shiki-themes github-light github-dark","\u003Cdiv style=\"text-align:center; margin-top: 20px;\">\n    \u003Ca href=\"https:\u002F\u002F\u003Cyour-instance-name>.flowfuse.cloud\u002Freport.pdf\" download=\"report.pdf\"\n        style=\"display: inline-block; background-color: #4f7a28; color: white; padding: 14px 20px; text-align: center; text-decoration: none; font-size: 16px; border-radius: 5px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); transition: background-color 0.3s ease;\">\n        Download Report\n    \u003C\u002Fa>\n\u003C\u002Fdiv>\n","html",[52,2412,2413,2433,2461,2473,2478,2487],{"__ignoreMap":375},[379,2414,2415,2418,2422,2425,2427,2430],{"class":381,"line":382},[379,2416,2417],{"class":385},"\u003C",[379,2419,2421],{"class":2420},"s9eBZ","div",[379,2423,2424],{"class":1492}," style",[379,2426,2156],{"class":385},[379,2428,2429],{"class":414},"\"text-align:center; margin-top: 20px;\"",[379,2431,2432],{"class":385},">\n",[379,2434,2435,2438,2440,2443,2445,2448,2450,2453,2456,2458],{"class":381,"line":389},[379,2436,2437],{"class":385},"    \u003C",[379,2439,32],{"class":2420},[379,2441,2442],{"class":1492}," href",[379,2444,2156],{"class":385},[379,2446,2447],{"class":414},"\"https:\u002F\u002F",[379,2449,2417],{"class":2296},[379,2451,2452],{"class":414},"your-instance-name>.flowfuse.cloud\u002Freport.pdf\"",[379,2454,2455],{"class":1492}," download",[379,2457,2156],{"class":385},[379,2459,2460],{"class":414},"\"report.pdf\"\n",[379,2462,2463,2466,2468,2471],{"class":381,"line":399},[379,2464,2465],{"class":1492},"        style",[379,2467,2156],{"class":385},[379,2469,2470],{"class":414},"\"display: inline-block; background-color: #4f7a28; color: white; padding: 14px 20px; text-align: center; text-decoration: none; font-size: 16px; border-radius: 5px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); transition: background-color 0.3s ease;\"",[379,2472,2432],{"class":385},[379,2474,2475],{"class":381,"line":405},[379,2476,2477],{"class":385},"        Download Report\n",[379,2479,2480,2483,2485],{"class":381,"line":421},[379,2481,2482],{"class":385},"    \u003C\u002F",[379,2484,32],{"class":2420},[379,2486,2432],{"class":385},[379,2488,2489,2492,2494],{"class":381,"line":434},[379,2490,2491],{"class":385},"\u003C\u002F",[379,2493,2421],{"class":2420},[379,2495,2432],{"class":385},[86,2497,2498],{"start":421},[28,2499,2500],{},"Deploy the flow.",[10,2502,2503,2507],{},[1306,2504],{"alt":2505,"dataZoomable":375,"src":2506},"Dashboard displaying embedded PDF with a download button","\u002Fblog\u002F2025\u002F05\u002Fimages\u002Fdashboard-with-embedded-report.png",[1311,2508,2509],{},[379,2510,2505],{},[17,2512,2514],{"id":2513},"final-thought","Final thought",[10,2516,2517,2518,2523],{},"Automating PDF report generation in Node-RED is a great way to save time and effort. Using tools like the node-red-contrib-pdfmake node, you can quickly turn your data into well-designed PDFs without manual work. If you want to save time and avoid the setup process, you can directly use our ready-made ",[32,2519,2522],{"href":2520,"rel":2521},"https:\u002F\u002Fflowfuse.com\u002Fblueprints\u002Fmanufacturing\u002Fpdf-report-generator\u002F",[36],"PDF generation blueprint",". It’s an easy way to get started and generate professional reports quickly.",[183,2525,2526],{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s7hpK, html code.shiki .s7hpK{--shiki-default:#B31D28;--shiki-default-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}",{"title":375,"searchDepth":389,"depth":389,"links":2528},[2529,2530,2537],{"id":19,"depth":389,"text":20},{"id":66,"depth":389,"text":67,"children":2531},[2532,2533,2534,2535,2536],{"id":74,"depth":399,"text":75},{"id":121,"depth":399,"text":122},{"id":1315,"depth":399,"text":1316},{"id":2230,"depth":399,"text":2231},{"id":2351,"depth":399,"text":2352},{"id":2513,"depth":389,"text":2514},"md",{"navTitle":5,"excerpt":2540},{"type":7,"value":2541},[2542],[10,2543,12],{},"\u002Fblog\u002F2025\u002F05\u002Fhow-to-generate-pdf-reports-using-node-red",{"title":5,"description":12},"blog\u002F2025\u002F05\u002Fhow-to-generate-pdf-reports-using-node-red","RkJK9jHJxSNLSCWLncwkUR8adrYGN8aV5BKsHk1C2H0",1780132427849]