[{"data":1,"prerenderedAt":1768},["ShallowReactive",2],{"navigation_docs_en":3,"-en-docx-patch":288,"-en-docx-patch-surround":1763},[4,23,57,87,163,240],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":22},"Getting Started","i-lucide-rocket","\u002Fen\u002Fgetting-started","en\u002F01.getting-started",[10,14,18],{"title":11,"path":12,"stem":13},"Introduction","\u002Fen\u002Fgetting-started\u002Fintroduction","en\u002F01.getting-started\u002F01.introduction",{"title":15,"path":16,"stem":17},"Installation","\u002Fen\u002Fgetting-started\u002Finstallation","en\u002F01.getting-started\u002F02.installation",{"title":19,"path":20,"stem":21},"AI Integration","\u002Fen\u002Fgetting-started\u002Fai-integration","en\u002F01.getting-started\u002F03.ai-integration",false,{"title":24,"icon":25,"path":26,"stem":27,"children":28,"page":22},"CORE","i-lucide-box","\u002Fen\u002Fcore","en\u002F02.core",[29,33,37,41,45,49,53],{"title":30,"path":31,"stem":32},"@office-open\u002Fcore","\u002Fen\u002Fcore\u002Foverview","en\u002F02.core\u002F01.overview",{"title":34,"path":35,"stem":36},"XML Components","\u002Fen\u002Fcore\u002Fxml-components","en\u002F02.core\u002F02.xml-components",{"title":38,"path":39,"stem":40},"Values and Validation","\u002Fen\u002Fcore\u002Fvalues","en\u002F02.core\u002F03.values",{"title":42,"path":43,"stem":44},"Unit Converters","\u002Fen\u002Fcore\u002Fconverters","en\u002F02.core\u002F04.converters",{"title":46,"path":47,"stem":48},"Formatter","\u002Fen\u002Fcore\u002Fformatter","en\u002F02.core\u002F05.formatter",{"title":50,"path":51,"stem":52},"Charts","\u002Fen\u002Fcore\u002Fcharts","en\u002F02.core\u002F06.charts",{"title":54,"path":55,"stem":56},"Parser","\u002Fen\u002Fcore\u002Fparser","en\u002F02.core\u002F07.parser",{"title":58,"icon":59,"path":60,"stem":61,"children":62,"page":22},"XML","i-lucide-code-xml","\u002Fen\u002Fxml","en\u002F03.xml",[63,67,71,75,79,83],{"title":64,"path":65,"stem":66},"@office-open\u002Fxml","\u002Fen\u002Fxml\u002Foverview","en\u002F03.xml\u002F01.overview",{"title":68,"path":69,"stem":70},"Parsing","\u002Fen\u002Fxml\u002Fparsing","en\u002F03.xml\u002F02.parsing",{"title":72,"path":73,"stem":74},"Serialization","\u002Fen\u002Fxml\u002Fserialization","en\u002F03.xml\u002F03.serialization",{"title":76,"path":77,"stem":78},"Query Utilities","\u002Fen\u002Fxml\u002Fquery-utilities","en\u002F03.xml\u002F04.query-utilities",{"title":80,"path":81,"stem":82},"XML Escape","\u002Fen\u002Fxml\u002Fescape","en\u002F03.xml\u002F05.escape",{"title":84,"path":85,"stem":86},"Type Reference","\u002Fen\u002Fxml\u002Ftypes","en\u002F03.xml\u002F06.types",{"title":88,"icon":89,"path":90,"stem":91,"children":92,"page":22},"DOCX","i-lucide-file-text","\u002Fen\u002Fdocx","en\u002F04.docx",[93,97,101,105,109,113,116,120,124,128,132,136,140,144,148,152,156,159],{"title":94,"path":95,"stem":96},"@office-open\u002Fdocx","\u002Fen\u002Fdocx\u002Foverview","en\u002F04.docx\u002F01.overview",{"title":98,"path":99,"stem":100},"Quick Start","\u002Fen\u002Fdocx\u002Fquickstart","en\u002F04.docx\u002F02.quickstart",{"title":102,"path":103,"stem":104},"Text and Paragraphs","\u002Fen\u002Fdocx\u002Ftext-and-paragraphs","en\u002F04.docx\u002F03.text-and-paragraphs",{"title":106,"path":107,"stem":108},"Tables","\u002Fen\u002Fdocx\u002Ftables","en\u002F04.docx\u002F04.tables",{"title":110,"path":111,"stem":112},"Images","\u002Fen\u002Fdocx\u002Fimages","en\u002F04.docx\u002F05.images",{"title":50,"path":114,"stem":115},"\u002Fen\u002Fdocx\u002Fcharts","en\u002F04.docx\u002F06.charts",{"title":117,"path":118,"stem":119},"SmartArt","\u002Fen\u002Fdocx\u002Fsmartart","en\u002F04.docx\u002F07.smartart",{"title":121,"path":122,"stem":123},"Media","\u002Fen\u002Fdocx\u002Fmedia","en\u002F04.docx\u002F08.media",{"title":125,"path":126,"stem":127},"Links","\u002Fen\u002Fdocx\u002Flinks","en\u002F04.docx\u002F09.links",{"title":129,"path":130,"stem":131},"Headers and Footers","\u002Fen\u002Fdocx\u002Fheaders-and-footers","en\u002F04.docx\u002F10.headers-and-footers",{"title":133,"path":134,"stem":135},"Equations and Symbols","\u002Fen\u002Fdocx\u002Fequations-and-symbols","en\u002F04.docx\u002F11.equations-and-symbols",{"title":137,"path":138,"stem":139},"Styles and Themes","\u002Fen\u002Fdocx\u002Fstyles-and-themes","en\u002F04.docx\u002F12.styles-and-themes",{"title":141,"path":142,"stem":143},"Page Layout","\u002Fen\u002Fdocx\u002Fpage-layout","en\u002F04.docx\u002F13.page-layout",{"title":145,"path":146,"stem":147},"References","\u002Fen\u002Fdocx\u002Freferences","en\u002F04.docx\u002F14.references",{"title":149,"path":150,"stem":151},"Comments and Revisions","\u002Fen\u002Fdocx\u002Fcomments-and-revisions","en\u002F04.docx\u002F15.comments-and-revisions",{"title":153,"path":154,"stem":155},"Export","\u002Fen\u002Fdocx\u002Fexport","en\u002F04.docx\u002F16.export",{"title":68,"path":157,"stem":158},"\u002Fen\u002Fdocx\u002Fparsing","en\u002F04.docx\u002F17.parsing",{"title":160,"path":161,"stem":162},"Patching","\u002Fen\u002Fdocx\u002Fpatch","en\u002F04.docx\u002F18.patch",{"title":164,"icon":165,"path":166,"stem":167,"children":168,"page":22},"PPTX","i-lucide-presentation","\u002Fen\u002Fpptx","en\u002F05.pptx",[169,173,176,180,183,186,189,192,195,198,202,205,208,212,215,219,223,227,231,234,237],{"title":170,"path":171,"stem":172},"@office-open\u002Fpptx","\u002Fen\u002Fpptx\u002Foverview","en\u002F05.pptx\u002F01.overview",{"title":98,"path":174,"stem":175},"\u002Fen\u002Fpptx\u002Fquickstart","en\u002F05.pptx\u002F02.quickstart",{"title":177,"path":178,"stem":179},"Shapes and Text","\u002Fen\u002Fpptx\u002Fshapes-and-text","en\u002F05.pptx\u002F03.shapes-and-text",{"title":106,"path":181,"stem":182},"\u002Fen\u002Fpptx\u002Ftables","en\u002F05.pptx\u002F04.tables",{"title":110,"path":184,"stem":185},"\u002Fen\u002Fpptx\u002Fimages","en\u002F05.pptx\u002F05.images",{"title":50,"path":187,"stem":188},"\u002Fen\u002Fpptx\u002Fcharts","en\u002F05.pptx\u002F06.charts",{"title":117,"path":190,"stem":191},"\u002Fen\u002Fpptx\u002Fsmartart","en\u002F05.pptx\u002F07.smartart",{"title":121,"path":193,"stem":194},"\u002Fen\u002Fpptx\u002Fmedia","en\u002F05.pptx\u002F08.media",{"title":125,"path":196,"stem":197},"\u002Fen\u002Fpptx\u002Flinks","en\u002F05.pptx\u002F09.links",{"title":199,"path":200,"stem":201},"Lines and Connectors","\u002Fen\u002Fpptx\u002Flines-and-connectors","en\u002F05.pptx\u002F10.lines-and-connectors",{"title":129,"path":203,"stem":204},"\u002Fen\u002Fpptx\u002Fheaders-and-footers","en\u002F05.pptx\u002F11.headers-and-footers",{"title":133,"path":206,"stem":207},"\u002Fen\u002Fpptx\u002Fequations-and-symbols","en\u002F05.pptx\u002F12.equations-and-symbols",{"title":209,"path":210,"stem":211},"Slide Layout","\u002Fen\u002Fpptx\u002Fslide-layout","en\u002F05.pptx\u002F13.slide-layout",{"title":137,"path":213,"stem":214},"\u002Fen\u002Fpptx\u002Fstyles-and-themes","en\u002F05.pptx\u002F14.styles-and-themes",{"title":216,"path":217,"stem":218},"Effects and Fills","\u002Fen\u002Fpptx\u002Feffects-and-fills","en\u002F05.pptx\u002F15.effects-and-fills",{"title":220,"path":221,"stem":222},"Transitions","\u002Fen\u002Fpptx\u002Ftransitions","en\u002F05.pptx\u002F16.transitions",{"title":224,"path":225,"stem":226},"Animations","\u002Fen\u002Fpptx\u002Fanimations","en\u002F05.pptx\u002F17.animations",{"title":228,"path":229,"stem":230},"Comments","\u002Fen\u002Fpptx\u002Fcomments","en\u002F05.pptx\u002F18.comments",{"title":153,"path":232,"stem":233},"\u002Fen\u002Fpptx\u002Fexport","en\u002F05.pptx\u002F19.export",{"title":68,"path":235,"stem":236},"\u002Fen\u002Fpptx\u002Fparsing","en\u002F05.pptx\u002F20.parsing",{"title":160,"path":238,"stem":239},"\u002Fen\u002Fpptx\u002Fpatch","en\u002F05.pptx\u002F21.patch",{"title":241,"icon":242,"path":243,"stem":244,"children":245,"page":22},"XLSX","i-lucide-table-2","\u002Fen\u002Fxlsx","en\u002F06.xlsx",[246,250,253,257,261,265,269,272,275,279,282,285],{"title":247,"path":248,"stem":249},"@office-open\u002Fxlsx","\u002Fen\u002Fxlsx\u002Foverview","en\u002F06.xlsx\u002F01.overview",{"title":98,"path":251,"stem":252},"\u002Fen\u002Fxlsx\u002Fquickstart","en\u002F06.xlsx\u002F02.quickstart",{"title":254,"path":255,"stem":256},"Cells & Data","\u002Fen\u002Fxlsx\u002Fcells","en\u002F06.xlsx\u002F03.cells",{"title":258,"path":259,"stem":260},"Styles","\u002Fen\u002Fxlsx\u002Fstyles","en\u002F06.xlsx\u002F04.styles",{"title":262,"path":263,"stem":264},"Merge, Columns & Rows","\u002Fen\u002Fxlsx\u002Fmerge-col-row","en\u002F06.xlsx\u002F05.merge-col-row",{"title":266,"path":267,"stem":268},"Freeze Panes & Auto Filter","\u002Fen\u002Fxlsx\u002Ffreeze-filter","en\u002F06.xlsx\u002F06.freeze-filter",{"title":110,"path":270,"stem":271},"\u002Fen\u002Fxlsx\u002Fimages","en\u002F06.xlsx\u002F07.images",{"title":50,"path":273,"stem":274},"\u002Fen\u002Fxlsx\u002Fcharts","en\u002F06.xlsx\u002F08.charts",{"title":276,"path":277,"stem":278},"Data Validation","\u002Fen\u002Fxlsx\u002Fvalidation","en\u002F06.xlsx\u002F09.validation",{"title":153,"path":280,"stem":281},"\u002Fen\u002Fxlsx\u002Fexport","en\u002F06.xlsx\u002F10.export",{"title":68,"path":283,"stem":284},"\u002Fen\u002Fxlsx\u002Fparsing","en\u002F06.xlsx\u002F11.parsing",{"title":160,"path":286,"stem":287},"\u002Fen\u002Fxlsx\u002Fpatch","en\u002F06.xlsx\u002F12.patch",{"id":289,"title":160,"body":290,"description":1757,"extension":1758,"links":1759,"meta":1760,"navigation":454,"path":161,"seo":1761,"stem":162,"__hash__":1762},"docs_en\u002Fen\u002F04.docx\u002F18.patch.md",{"type":291,"value":292,"toc":1744},"minimark",[293,306,311,317,643,647,687,691,694,819,823,826,1037,1040,1043,1189,1193,1196,1334,1338,1352,1491,1495,1621,1625,1628,1709,1713,1740],[294,295,296,297,301,302,305],"p",{},"Patch an existing ",[298,299,300],"code",{},".docx"," template by replacing ",[298,303,304],{},"{{placeholder}}"," tokens with new content — paragraphs, tables, images, hyperlinks, and more.",[307,308,310],"h2",{"id":309},"patchdocument","patchDocument",[294,312,313,314,316],{},"Replaces placeholders in an existing ",[298,315,300],{}," file:",[318,319,324],"pre",{"className":320,"code":321,"language":322,"meta":323,"style":323},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import {\n  patchDocument,\n  PatchType,\n  TextRun,\n  Paragraph,\n  Table,\n  TableRow,\n  TableCell,\n} from \"@office-open\u002Fdocx\";\nimport { readFileSync, writeFileSync } from \"node:fs\";\n\nconst result = await patchDocument({\n  outputType: \"nodebuffer\",\n  data: readFileSync(\"template.docx\"),\n  patches: {\n    name: {\n      type: PatchType.PARAGRAPH,\n      children: [new TextRun(\"John Doe\")],\n    },\n  },\n});\n\nwriteFileSync(\"output.docx\", result);\n","ts","",[298,325,326,339,349,357,365,373,381,389,397,418,449,456,482,501,525,535,545,564,595,601,607,616,621],{"__ignoreMap":323},[327,328,331,335],"span",{"class":329,"line":330},"line",1,[327,332,334],{"class":333},"s7zQu","import",[327,336,338],{"class":337},"sMK4o"," {\n",[327,340,342,346],{"class":329,"line":341},2,[327,343,345],{"class":344},"sTEyZ","  patchDocument",[327,347,348],{"class":337},",\n",[327,350,352,355],{"class":329,"line":351},3,[327,353,354],{"class":344},"  PatchType",[327,356,348],{"class":337},[327,358,360,363],{"class":329,"line":359},4,[327,361,362],{"class":344},"  TextRun",[327,364,348],{"class":337},[327,366,368,371],{"class":329,"line":367},5,[327,369,370],{"class":344},"  Paragraph",[327,372,348],{"class":337},[327,374,376,379],{"class":329,"line":375},6,[327,377,378],{"class":344},"  Table",[327,380,348],{"class":337},[327,382,384,387],{"class":329,"line":383},7,[327,385,386],{"class":344},"  TableRow",[327,388,348],{"class":337},[327,390,392,395],{"class":329,"line":391},8,[327,393,394],{"class":344},"  TableCell",[327,396,348],{"class":337},[327,398,400,403,406,409,412,415],{"class":329,"line":399},9,[327,401,402],{"class":337},"}",[327,404,405],{"class":333}," from",[327,407,408],{"class":337}," \"",[327,410,94],{"class":411},"sfazB",[327,413,414],{"class":337},"\"",[327,416,417],{"class":337},";\n",[327,419,421,423,426,429,432,435,438,440,442,445,447],{"class":329,"line":420},10,[327,422,334],{"class":333},[327,424,425],{"class":337}," {",[327,427,428],{"class":344}," readFileSync",[327,430,431],{"class":337},",",[327,433,434],{"class":344}," writeFileSync",[327,436,437],{"class":337}," }",[327,439,405],{"class":333},[327,441,408],{"class":337},[327,443,444],{"class":411},"node:fs",[327,446,414],{"class":337},[327,448,417],{"class":337},[327,450,452],{"class":329,"line":451},11,[327,453,455],{"emptyLinePlaceholder":454},true,"\n",[327,457,459,463,466,469,472,476,479],{"class":329,"line":458},12,[327,460,462],{"class":461},"spNyl","const",[327,464,465],{"class":344}," result ",[327,467,468],{"class":337},"=",[327,470,471],{"class":333}," await",[327,473,475],{"class":474},"s2Zo4"," patchDocument",[327,477,478],{"class":344},"(",[327,480,481],{"class":337},"{\n",[327,483,485,489,492,494,497,499],{"class":329,"line":484},13,[327,486,488],{"class":487},"swJcz","  outputType",[327,490,491],{"class":337},":",[327,493,408],{"class":337},[327,495,496],{"class":411},"nodebuffer",[327,498,414],{"class":337},[327,500,348],{"class":337},[327,502,504,507,509,511,513,515,518,520,523],{"class":329,"line":503},14,[327,505,506],{"class":487},"  data",[327,508,491],{"class":337},[327,510,428],{"class":474},[327,512,478],{"class":344},[327,514,414],{"class":337},[327,516,517],{"class":411},"template.docx",[327,519,414],{"class":337},[327,521,522],{"class":344},")",[327,524,348],{"class":337},[327,526,528,531,533],{"class":329,"line":527},15,[327,529,530],{"class":487},"  patches",[327,532,491],{"class":337},[327,534,338],{"class":337},[327,536,538,541,543],{"class":329,"line":537},16,[327,539,540],{"class":487},"    name",[327,542,491],{"class":337},[327,544,338],{"class":337},[327,546,548,551,553,556,559,562],{"class":329,"line":547},17,[327,549,550],{"class":487},"      type",[327,552,491],{"class":337},[327,554,555],{"class":344}," PatchType",[327,557,558],{"class":337},".",[327,560,561],{"class":344},"PARAGRAPH",[327,563,348],{"class":337},[327,565,567,570,572,575,578,581,583,585,588,590,593],{"class":329,"line":566},18,[327,568,569],{"class":487},"      children",[327,571,491],{"class":337},[327,573,574],{"class":344}," [",[327,576,577],{"class":337},"new",[327,579,580],{"class":474}," TextRun",[327,582,478],{"class":344},[327,584,414],{"class":337},[327,586,587],{"class":411},"John Doe",[327,589,414],{"class":337},[327,591,592],{"class":344},")]",[327,594,348],{"class":337},[327,596,598],{"class":329,"line":597},19,[327,599,600],{"class":337},"    },\n",[327,602,604],{"class":329,"line":603},20,[327,605,606],{"class":337},"  },\n",[327,608,610,612,614],{"class":329,"line":609},21,[327,611,402],{"class":337},[327,613,522],{"class":344},[327,615,417],{"class":337},[327,617,619],{"class":329,"line":618},22,[327,620,455],{"emptyLinePlaceholder":454},[327,622,624,627,629,631,634,636,638,641],{"class":329,"line":623},23,[327,625,626],{"class":474},"writeFileSync",[327,628,478],{"class":344},[327,630,414],{"class":337},[327,632,633],{"class":411},"output.docx",[327,635,414],{"class":337},[327,637,431],{"class":337},[327,639,640],{"class":344}," result)",[327,642,417],{"class":337},[307,644,646],{"id":645},"patchtype","PatchType",[648,649,650,663],"table",{},[651,652,653],"thead",{},[654,655,656,660],"tr",{},[657,658,659],"th",{},"Type",[657,661,662],{},"Description",[664,665,666,677],"tbody",{},[654,667,668,674],{},[669,670,671],"td",{},[298,672,673],{},"PatchType.PARAGRAPH",[669,675,676],{},"Replace the placeholder with inline run-level content",[654,678,679,684],{},[669,680,681],{},[298,682,683],{},"PatchType.DOCUMENT",[669,685,686],{},"Replace the placeholder with block-level content",[688,689,561],"h3",{"id":690},"paragraph",[294,692,693],{},"Replaces the placeholder text inside a paragraph with new runs. The original run's formatting properties (font, size, color, bold, etc.) are preserved by default.",[318,695,697],{"className":320,"code":696,"language":322,"meta":323,"style":323},"patches: {\n  title: {\n    type: PatchType.PARAGRAPH,\n    children: [\n      new TextRun({ text: \"Hello \", bold: true }),\n      new TextRun(\"World\"),\n    ],\n  },\n}\n",[298,698,699,709,718,733,743,784,803,810,814],{"__ignoreMap":323},[327,700,701,705,707],{"class":329,"line":330},[327,702,704],{"class":703},"sBMFI","patches",[327,706,491],{"class":337},[327,708,338],{"class":337},[327,710,711,714,716],{"class":329,"line":341},[327,712,713],{"class":703},"  title",[327,715,491],{"class":337},[327,717,338],{"class":337},[327,719,720,723,725,727,729,731],{"class":329,"line":351},[327,721,722],{"class":703},"    type",[327,724,491],{"class":337},[327,726,555],{"class":344},[327,728,558],{"class":337},[327,730,561],{"class":344},[327,732,348],{"class":337},[327,734,735,738,740],{"class":329,"line":359},[327,736,737],{"class":703},"    children",[327,739,491],{"class":337},[327,741,742],{"class":487}," [\n",[327,744,745,748,750,752,755,758,760,762,765,767,769,772,774,778,780,782],{"class":329,"line":367},[327,746,747],{"class":337},"      new",[327,749,580],{"class":474},[327,751,478],{"class":487},[327,753,754],{"class":337},"{",[327,756,757],{"class":487}," text",[327,759,491],{"class":337},[327,761,408],{"class":337},[327,763,764],{"class":411},"Hello ",[327,766,414],{"class":337},[327,768,431],{"class":337},[327,770,771],{"class":487}," bold",[327,773,491],{"class":337},[327,775,777],{"class":776},"sfNiH"," true",[327,779,437],{"class":337},[327,781,522],{"class":487},[327,783,348],{"class":337},[327,785,786,788,790,792,794,797,799,801],{"class":329,"line":375},[327,787,747],{"class":337},[327,789,580],{"class":474},[327,791,478],{"class":487},[327,793,414],{"class":337},[327,795,796],{"class":411},"World",[327,798,414],{"class":337},[327,800,522],{"class":487},[327,802,348],{"class":337},[327,804,805,808],{"class":329,"line":383},[327,806,807],{"class":487},"    ]",[327,809,348],{"class":337},[327,811,812],{"class":329,"line":391},[327,813,606],{"class":337},[327,815,816],{"class":329,"line":399},[327,817,818],{"class":337},"}\n",[688,820,822],{"id":821},"document","DOCUMENT",[294,824,825],{},"Replaces the placeholder with block-level elements (paragraphs, tables, etc.). The surrounding context is preserved.",[318,827,829],{"className":320,"code":828,"language":322,"meta":323,"style":323},"patches: {\n  content: {\n    type: PatchType.DOCUMENT,\n    children: [\n      new Paragraph(\"First paragraph\"),\n      new Paragraph(\"Second paragraph\"),\n      new Table({\n        rows: [\n          new TableRow({\n            children: [\n              new TableCell({ children: [new Paragraph(\"Cell\")] }),\n            ],\n          }),\n        ],\n      }),\n    ],\n  },\n}\n",[298,830,831,839,848,862,870,890,909,920,929,941,950,991,998,1007,1014,1023,1029,1033],{"__ignoreMap":323},[327,832,833,835,837],{"class":329,"line":330},[327,834,704],{"class":703},[327,836,491],{"class":337},[327,838,338],{"class":337},[327,840,841,844,846],{"class":329,"line":341},[327,842,843],{"class":703},"  content",[327,845,491],{"class":337},[327,847,338],{"class":337},[327,849,850,852,854,856,858,860],{"class":329,"line":351},[327,851,722],{"class":703},[327,853,491],{"class":337},[327,855,555],{"class":344},[327,857,558],{"class":337},[327,859,822],{"class":344},[327,861,348],{"class":337},[327,863,864,866,868],{"class":329,"line":359},[327,865,737],{"class":703},[327,867,491],{"class":337},[327,869,742],{"class":487},[327,871,872,874,877,879,881,884,886,888],{"class":329,"line":367},[327,873,747],{"class":337},[327,875,876],{"class":474}," Paragraph",[327,878,478],{"class":487},[327,880,414],{"class":337},[327,882,883],{"class":411},"First paragraph",[327,885,414],{"class":337},[327,887,522],{"class":487},[327,889,348],{"class":337},[327,891,892,894,896,898,900,903,905,907],{"class":329,"line":375},[327,893,747],{"class":337},[327,895,876],{"class":474},[327,897,478],{"class":487},[327,899,414],{"class":337},[327,901,902],{"class":411},"Second paragraph",[327,904,414],{"class":337},[327,906,522],{"class":487},[327,908,348],{"class":337},[327,910,911,913,916,918],{"class":329,"line":383},[327,912,747],{"class":337},[327,914,915],{"class":474}," Table",[327,917,478],{"class":487},[327,919,481],{"class":337},[327,921,922,925,927],{"class":329,"line":391},[327,923,924],{"class":487},"        rows",[327,926,491],{"class":337},[327,928,742],{"class":487},[327,930,931,934,937,939],{"class":329,"line":399},[327,932,933],{"class":337},"          new",[327,935,936],{"class":474}," TableRow",[327,938,478],{"class":487},[327,940,481],{"class":337},[327,942,943,946,948],{"class":329,"line":420},[327,944,945],{"class":487},"            children",[327,947,491],{"class":337},[327,949,742],{"class":487},[327,951,952,955,958,960,962,965,967,969,971,973,975,977,980,982,985,987,989],{"class":329,"line":451},[327,953,954],{"class":337},"              new",[327,956,957],{"class":474}," TableCell",[327,959,478],{"class":487},[327,961,754],{"class":337},[327,963,964],{"class":487}," children",[327,966,491],{"class":337},[327,968,574],{"class":487},[327,970,577],{"class":337},[327,972,876],{"class":474},[327,974,478],{"class":487},[327,976,414],{"class":337},[327,978,979],{"class":411},"Cell",[327,981,414],{"class":337},[327,983,984],{"class":487},")] ",[327,986,402],{"class":337},[327,988,522],{"class":487},[327,990,348],{"class":337},[327,992,993,996],{"class":329,"line":458},[327,994,995],{"class":487},"            ]",[327,997,348],{"class":337},[327,999,1000,1003,1005],{"class":329,"line":484},[327,1001,1002],{"class":337},"          }",[327,1004,522],{"class":487},[327,1006,348],{"class":337},[327,1008,1009,1012],{"class":329,"line":503},[327,1010,1011],{"class":487},"        ]",[327,1013,348],{"class":337},[327,1015,1016,1019,1021],{"class":329,"line":527},[327,1017,1018],{"class":337},"      }",[327,1020,522],{"class":487},[327,1022,348],{"class":337},[327,1024,1025,1027],{"class":329,"line":537},[327,1026,807],{"class":487},[327,1028,348],{"class":337},[327,1030,1031],{"class":329,"line":547},[327,1032,606],{"class":337},[327,1034,1035],{"class":329,"line":566},[327,1036,818],{"class":337},[307,1038,110],{"id":1039},"images",[294,1041,1042],{},"Replace a placeholder with an image:",[318,1044,1046],{"className":320,"code":1045,"language":322,"meta":323,"style":323},"patches: {\n  logo: {\n    type: PatchType.PARAGRAPH,\n    children: [\n      new ImageRun({\n        data: readFileSync(\"logo.png\"),\n        transformation: { width: 200, height: 100 },\n        type: \"png\",\n      }),\n    ],\n  },\n}\n",[298,1047,1048,1056,1065,1079,1087,1098,1120,1151,1167,1175,1181,1185],{"__ignoreMap":323},[327,1049,1050,1052,1054],{"class":329,"line":330},[327,1051,704],{"class":703},[327,1053,491],{"class":337},[327,1055,338],{"class":337},[327,1057,1058,1061,1063],{"class":329,"line":341},[327,1059,1060],{"class":703},"  logo",[327,1062,491],{"class":337},[327,1064,338],{"class":337},[327,1066,1067,1069,1071,1073,1075,1077],{"class":329,"line":351},[327,1068,722],{"class":703},[327,1070,491],{"class":337},[327,1072,555],{"class":344},[327,1074,558],{"class":337},[327,1076,561],{"class":344},[327,1078,348],{"class":337},[327,1080,1081,1083,1085],{"class":329,"line":359},[327,1082,737],{"class":703},[327,1084,491],{"class":337},[327,1086,742],{"class":487},[327,1088,1089,1091,1094,1096],{"class":329,"line":367},[327,1090,747],{"class":337},[327,1092,1093],{"class":474}," ImageRun",[327,1095,478],{"class":487},[327,1097,481],{"class":337},[327,1099,1100,1103,1105,1107,1109,1111,1114,1116,1118],{"class":329,"line":375},[327,1101,1102],{"class":487},"        data",[327,1104,491],{"class":337},[327,1106,428],{"class":474},[327,1108,478],{"class":487},[327,1110,414],{"class":337},[327,1112,1113],{"class":411},"logo.png",[327,1115,414],{"class":337},[327,1117,522],{"class":487},[327,1119,348],{"class":337},[327,1121,1122,1125,1127,1129,1132,1134,1138,1140,1143,1145,1148],{"class":329,"line":383},[327,1123,1124],{"class":487},"        transformation",[327,1126,491],{"class":337},[327,1128,425],{"class":337},[327,1130,1131],{"class":487}," width",[327,1133,491],{"class":337},[327,1135,1137],{"class":1136},"sbssI"," 200",[327,1139,431],{"class":337},[327,1141,1142],{"class":487}," height",[327,1144,491],{"class":337},[327,1146,1147],{"class":1136}," 100",[327,1149,1150],{"class":337}," },\n",[327,1152,1153,1156,1158,1160,1163,1165],{"class":329,"line":391},[327,1154,1155],{"class":487},"        type",[327,1157,491],{"class":337},[327,1159,408],{"class":337},[327,1161,1162],{"class":411},"png",[327,1164,414],{"class":337},[327,1166,348],{"class":337},[327,1168,1169,1171,1173],{"class":329,"line":399},[327,1170,1018],{"class":337},[327,1172,522],{"class":487},[327,1174,348],{"class":337},[327,1176,1177,1179],{"class":329,"line":420},[327,1178,807],{"class":487},[327,1180,348],{"class":337},[327,1182,1183],{"class":329,"line":451},[327,1184,606],{"class":337},[327,1186,1187],{"class":329,"line":458},[327,1188,818],{"class":337},[307,1190,1192],{"id":1191},"hyperlinks","Hyperlinks",[294,1194,1195],{},"Include hyperlinks in patch content:",[318,1197,1199],{"className":320,"code":1198,"language":322,"meta":323,"style":323},"patches: {\n  website: {\n    type: PatchType.PARAGRAPH,\n    children: [\n      new TextRun(\"Visit \"),\n      new ExternalHyperlink({\n        children: [new TextRun(\"our website\")],\n        link: \"https:\u002F\u002Fexample.com\",\n      }),\n    ],\n  },\n}\n",[298,1200,1201,1209,1218,1232,1240,1259,1270,1296,1312,1320,1326,1330],{"__ignoreMap":323},[327,1202,1203,1205,1207],{"class":329,"line":330},[327,1204,704],{"class":703},[327,1206,491],{"class":337},[327,1208,338],{"class":337},[327,1210,1211,1214,1216],{"class":329,"line":341},[327,1212,1213],{"class":703},"  website",[327,1215,491],{"class":337},[327,1217,338],{"class":337},[327,1219,1220,1222,1224,1226,1228,1230],{"class":329,"line":351},[327,1221,722],{"class":703},[327,1223,491],{"class":337},[327,1225,555],{"class":344},[327,1227,558],{"class":337},[327,1229,561],{"class":344},[327,1231,348],{"class":337},[327,1233,1234,1236,1238],{"class":329,"line":359},[327,1235,737],{"class":703},[327,1237,491],{"class":337},[327,1239,742],{"class":487},[327,1241,1242,1244,1246,1248,1250,1253,1255,1257],{"class":329,"line":367},[327,1243,747],{"class":337},[327,1245,580],{"class":474},[327,1247,478],{"class":487},[327,1249,414],{"class":337},[327,1251,1252],{"class":411},"Visit ",[327,1254,414],{"class":337},[327,1256,522],{"class":487},[327,1258,348],{"class":337},[327,1260,1261,1263,1266,1268],{"class":329,"line":375},[327,1262,747],{"class":337},[327,1264,1265],{"class":474}," ExternalHyperlink",[327,1267,478],{"class":487},[327,1269,481],{"class":337},[327,1271,1272,1275,1277,1279,1281,1283,1285,1287,1290,1292,1294],{"class":329,"line":383},[327,1273,1274],{"class":487},"        children",[327,1276,491],{"class":337},[327,1278,574],{"class":487},[327,1280,577],{"class":337},[327,1282,580],{"class":474},[327,1284,478],{"class":487},[327,1286,414],{"class":337},[327,1288,1289],{"class":411},"our website",[327,1291,414],{"class":337},[327,1293,592],{"class":487},[327,1295,348],{"class":337},[327,1297,1298,1301,1303,1305,1308,1310],{"class":329,"line":391},[327,1299,1300],{"class":487},"        link",[327,1302,491],{"class":337},[327,1304,408],{"class":337},[327,1306,1307],{"class":411},"https:\u002F\u002Fexample.com",[327,1309,414],{"class":337},[327,1311,348],{"class":337},[327,1313,1314,1316,1318],{"class":329,"line":399},[327,1315,1018],{"class":337},[327,1317,522],{"class":487},[327,1319,348],{"class":337},[327,1321,1322,1324],{"class":329,"line":420},[327,1323,807],{"class":487},[327,1325,348],{"class":337},[327,1327,1328],{"class":329,"line":451},[327,1329,606],{"class":337},[327,1331,1332],{"class":329,"line":458},[327,1333,818],{"class":337},[307,1335,1337],{"id":1336},"custom-delimiters","Custom Delimiters",[294,1339,1340,1341,1344,1345,1348,1349,491],{},"Default delimiters are ",[298,1342,1343],{},"{{"," and ",[298,1346,1347],{},"}}",". Change them with ",[298,1350,1351],{},"placeholderDelimiters",[318,1353,1355],{"className":320,"code":1354,"language":322,"meta":323,"style":323},"await patchDocument({\n  outputType: \"nodebuffer\",\n  data: templateBuffer,\n  patches: { name: { type: PatchType.PARAGRAPH, children: [new TextRun(\"John\")] } },\n  placeholderDelimiters: { start: \"\u003C\u003C\", end: \">>\" },\n});\n",[298,1356,1357,1368,1382,1393,1446,1483],{"__ignoreMap":323},[327,1358,1359,1362,1364,1366],{"class":329,"line":330},[327,1360,1361],{"class":333},"await",[327,1363,475],{"class":474},[327,1365,478],{"class":344},[327,1367,481],{"class":337},[327,1369,1370,1372,1374,1376,1378,1380],{"class":329,"line":341},[327,1371,488],{"class":487},[327,1373,491],{"class":337},[327,1375,408],{"class":337},[327,1377,496],{"class":411},[327,1379,414],{"class":337},[327,1381,348],{"class":337},[327,1383,1384,1386,1388,1391],{"class":329,"line":351},[327,1385,506],{"class":487},[327,1387,491],{"class":337},[327,1389,1390],{"class":344}," templateBuffer",[327,1392,348],{"class":337},[327,1394,1395,1397,1399,1401,1404,1406,1408,1411,1413,1415,1417,1419,1421,1423,1425,1427,1429,1431,1433,1435,1438,1440,1442,1444],{"class":329,"line":359},[327,1396,530],{"class":487},[327,1398,491],{"class":337},[327,1400,425],{"class":337},[327,1402,1403],{"class":487}," name",[327,1405,491],{"class":337},[327,1407,425],{"class":337},[327,1409,1410],{"class":487}," type",[327,1412,491],{"class":337},[327,1414,555],{"class":344},[327,1416,558],{"class":337},[327,1418,561],{"class":344},[327,1420,431],{"class":337},[327,1422,964],{"class":487},[327,1424,491],{"class":337},[327,1426,574],{"class":344},[327,1428,577],{"class":337},[327,1430,580],{"class":474},[327,1432,478],{"class":344},[327,1434,414],{"class":337},[327,1436,1437],{"class":411},"John",[327,1439,414],{"class":337},[327,1441,984],{"class":344},[327,1443,402],{"class":337},[327,1445,1150],{"class":337},[327,1447,1448,1451,1453,1455,1458,1460,1462,1465,1467,1469,1472,1474,1476,1479,1481],{"class":329,"line":367},[327,1449,1450],{"class":487},"  placeholderDelimiters",[327,1452,491],{"class":337},[327,1454,425],{"class":337},[327,1456,1457],{"class":487}," start",[327,1459,491],{"class":337},[327,1461,408],{"class":337},[327,1463,1464],{"class":411},"\u003C\u003C",[327,1466,414],{"class":337},[327,1468,431],{"class":337},[327,1470,1471],{"class":487}," end",[327,1473,491],{"class":337},[327,1475,408],{"class":337},[327,1477,1478],{"class":411},">>",[327,1480,414],{"class":337},[327,1482,1150],{"class":337},[327,1484,1485,1487,1489],{"class":329,"line":375},[327,1486,402],{"class":337},[327,1488,522],{"class":344},[327,1490,417],{"class":337},[307,1492,1494],{"id":1493},"options","Options",[648,1496,1497,1511],{},[651,1498,1499],{},[654,1500,1501,1504,1506,1509],{},[657,1502,1503],{},"Option",[657,1505,659],{},[657,1507,1508],{},"Default",[657,1510,662],{},[664,1512,1513,1531,1548,1564,1584,1603],{},[654,1514,1515,1520,1525,1528],{},[669,1516,1517],{},[298,1518,1519],{},"outputType",[669,1521,1522],{},[298,1523,1524],{},"string",[669,1526,1527],{},"—",[669,1529,1530],{},"Output format (see Export page)",[654,1532,1533,1538,1543,1545],{},[669,1534,1535],{},[298,1536,1537],{},"data",[669,1539,1540],{},[298,1541,1542],{},"Buffer | Uint8Array | ...",[669,1544,1527],{},[669,1546,1547],{},"Input .docx file data",[654,1549,1550,1554,1559,1561],{},[669,1551,1552],{},[298,1553,704],{},[669,1555,1556],{},[298,1557,1558],{},"Record\u003Cstring, IPatch>",[669,1560,1527],{},[669,1562,1563],{},"Map of placeholder name to patch content",[654,1565,1566,1571,1576,1581],{},[669,1567,1568],{},[298,1569,1570],{},"keepOriginalStyles",[669,1572,1573],{},[298,1574,1575],{},"boolean",[669,1577,1578],{},[298,1579,1580],{},"true",[669,1582,1583],{},"Preserve original run formatting properties",[654,1585,1586,1590,1595,1600],{},[669,1587,1588],{},[298,1589,1351],{},[669,1591,1592],{},[298,1593,1594],{},"{ start: string, end: string}",[669,1596,1597],{},[298,1598,1599],{},"{ {{, }} }",[669,1601,1602],{},"Custom placeholder delimiters",[654,1604,1605,1610,1614,1618],{},[669,1606,1607],{},[298,1608,1609],{},"recursive",[669,1611,1612],{},[298,1613,1575],{},[669,1615,1616],{},[298,1617,1580],{},[669,1619,1620],{},"Replace all occurrences (not just the first)",[307,1622,1624],{"id":1623},"patchdetector","patchDetector",[294,1626,1627],{},"Scan a template to discover all placeholder keys before patching:",[318,1629,1631],{"className":320,"code":1630,"language":322,"meta":323,"style":323},"import { patchDetector } from \"@office-open\u002Fdocx\";\n\nconst placeholders = await patchDetector({\n  data: readFileSync(\"template.docx\"),\n});\n\u002F\u002F [\"name\", \"title\", \"content\", ...]\n",[298,1632,1633,1654,1658,1675,1695,1703],{"__ignoreMap":323},[327,1634,1635,1637,1639,1642,1644,1646,1648,1650,1652],{"class":329,"line":330},[327,1636,334],{"class":333},[327,1638,425],{"class":337},[327,1640,1641],{"class":344}," patchDetector",[327,1643,437],{"class":337},[327,1645,405],{"class":333},[327,1647,408],{"class":337},[327,1649,94],{"class":411},[327,1651,414],{"class":337},[327,1653,417],{"class":337},[327,1655,1656],{"class":329,"line":341},[327,1657,455],{"emptyLinePlaceholder":454},[327,1659,1660,1662,1665,1667,1669,1671,1673],{"class":329,"line":351},[327,1661,462],{"class":461},[327,1663,1664],{"class":344}," placeholders ",[327,1666,468],{"class":337},[327,1668,471],{"class":333},[327,1670,1641],{"class":474},[327,1672,478],{"class":344},[327,1674,481],{"class":337},[327,1676,1677,1679,1681,1683,1685,1687,1689,1691,1693],{"class":329,"line":359},[327,1678,506],{"class":487},[327,1680,491],{"class":337},[327,1682,428],{"class":474},[327,1684,478],{"class":344},[327,1686,414],{"class":337},[327,1688,517],{"class":411},[327,1690,414],{"class":337},[327,1692,522],{"class":344},[327,1694,348],{"class":337},[327,1696,1697,1699,1701],{"class":329,"line":367},[327,1698,402],{"class":337},[327,1700,522],{"class":344},[327,1702,417],{"class":337},[327,1704,1705],{"class":329,"line":375},[327,1706,1708],{"class":1707},"sHwdD","\u002F\u002F [\"name\", \"title\", \"content\", ...]\n",[307,1710,1712],{"id":1711},"tips","Tips",[1714,1715,1716,1720,1727,1737],"ul",{},[1717,1718,1719],"li",{},"Placeholders span across split runs in Word — the library handles this automatically.",[1717,1721,1722,1723,1726],{},"Use ",[298,1724,1725],{},"keepOriginalStyles: true"," (default) to inherit the template's run formatting (font, size, color, etc.) when replacing text.",[1717,1728,1729,1732,1733,1736],{},[298,1730,1731],{},"recursive: true"," (default) replaces all occurrences of each placeholder; set to ",[298,1734,1735],{},"false"," to replace only the first.",[1717,1738,1739],{},"Images and hyperlinks in patch content are automatically added to the document's relationships.",[1741,1742,1743],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":323,"searchDepth":341,"depth":341,"links":1745},[1746,1747,1751,1752,1753,1754,1755,1756],{"id":309,"depth":341,"text":310},{"id":645,"depth":341,"text":646,"children":1748},[1749,1750],{"id":690,"depth":351,"text":561},{"id":821,"depth":351,"text":822},{"id":1039,"depth":341,"text":110},{"id":1191,"depth":341,"text":1192},{"id":1336,"depth":341,"text":1337},{"id":1493,"depth":341,"text":1494},{"id":1623,"depth":341,"text":1624},{"id":1711,"depth":341,"text":1712},"Modify existing .docx files by replacing placeholders with new content","md",null,{},{"title":160,"description":1757},"ObK6-3Qrd4gq1eS2a7Sk0ToAc0iDmSqGGihVOftTHxM",[1764,1766],{"title":68,"path":157,"stem":158,"description":1765,"children":-1},"Parse, inspect, and round-trip .docx files",{"title":170,"path":171,"stem":172,"description":1767,"children":-1},"Generate .pptx presentations with a declarative TypeScript API",1780139790060]