[{"data":1,"prerenderedAt":497},["ShallowReactive",2],{"ofd-doc:\u002Fen\u002Fguide\u002Fprinting":3,"ofd-source:recipes\u002Fprinter.ts":88,"mdc--8s90yx-key":89},{"id":4,"title":5,"body":6,"description":71,"extension":72,"keywords":73,"locale":79,"meta":80,"navigation":81,"order":82,"path":83,"section":84,"seo":85,"stem":86,"__hash__":87},"docs\u002Fguide\u002Fprinting.en.md","Printing and batch jobs",{"type":7,"value":8,"toc":65},"minimark",[9,14,23,26,30,45,49],[10,11,13],"h2",{"id":12},"print-from-the-workspace","Print from the workspace",[15,16,17,18,22],"p",{},"Open 文件 → 打印与批量打印. Use the current file or add more OFDs, arrange their order, choose physical pages for each file, and set copies and duplex mode. Inspect the native preview before selecting a destination. Page numbers start at 1. For example, ",[19,20,21],"code",{},"1,3-5"," selects four pages. An empty range selects all pages.",[15,24,25],{},"Browser printing opens the browser or system print dialog. Match its paper size to the document and tray. A4 measures 210 × 297 mm and Letter measures 215.9 × 279.4 mm. Mismatched media can introduce scaling or borders. Check margins and scale in the preview. The printable area at the edge also depends on the device.",[10,27,29],{"id":28},"submit-from-a-server","Submit from a server",[15,31,32,33,36,37,40,41,44],{},"The preview renders OFD pages directly. A Node service can print through IPP without a browser. For one complete file, a queue advertising native OFD can receive the original bytes. Page selections, batches and other printers can use the encoder below to produce an advertised PWG Raster or PDF print stream. Install ",[19,34,35],{},"sharp",", ",[19,38,39],{},"happy-dom"," and ",[19,42,43],{},"pdf-lib"," on the encoding host.",[46,47],"docs-recipe",{"name":48},"recipes\u002Fprinter",[15,50,51,52,55,56,59,60],{},"Jobs retain document order. In a duplex batch an odd page selection ends with a blank reverse side before the next document. Submission checks document print permissions, copy limits and device capabilities. A ",[19,53,54],{},"jobId"," signals queue acceptance. Query ",[19,57,58],{},"status(jobId, signal)"," to follow the job. If a submission loses its receipt, check the queue before retrying. ",[61,62,64],"a",{"href":63},"\u002Fen\u002Fapi","Print service API",{"title":66,"searchDepth":67,"depth":67,"links":68},"",2,[69,70],{"id":12,"depth":67,"text":13},{"id":28,"depth":67,"text":29},"Preview the native OFD pages, then send selected files and pages to the browser or a host queue.","md",[74,75,76,77,78],"打印","批量打印","IPP","PWG Raster","A4","en",{},true,3,"\u002Fen\u002Fguide\u002Fprinting","Workspace",{"title":5,"description":71},"guide\u002Fprinting.en","vm7YF2rM27s8Y_uJofVASdUCo0CeHd98BGaa705oHFg","import type { OFDPrintJob } from \"@quirekit\u002Fofd-editor\u002Fprint\";\nimport { createOFDIPPPrintService } from \"@quirekit\u002Fofd-editor\u002Fprint\u002Fipp\";\nimport { encodeNodeOFDPrintJob } from \"@quirekit\u002Fofd-editor\u002Fprint\u002Fnode\";\n\n\u002F**\n * Submits a validated batch to an operator-configured queue from Node.\n * @param printerUri - Printer URI from trusted server configuration.\n * @param job - Files, physical page selections, sides and copies approved by the user.\n * @param signal - Request lifetime.\n * @returns A receipt for querying queue status.\n *\u002F\nexport function submitToQueue(printerUri: string, job: OFDPrintJob, signal: AbortSignal) {\n  const queue = createOFDIPPPrintService({\n    label: \"Office\", printerUri, encode: encodeNodeOFDPrintJob,\n  });\n  return queue.submit(job, signal);\n}\n",{"data":90,"body":91},{},{"type":92,"children":93},"root",[94,491],{"type":95,"tag":96,"props":97,"children":101},"element","pre",{"className":98,"code":99,"language":100,"meta":66,"style":66},"language-ts shiki shiki-themes github-light github-light github-dark","import type { OFDPrintJob } from \"@quirekit\u002Fofd-editor\u002Fprint\";\nimport { createOFDIPPPrintService } from \"@quirekit\u002Fofd-editor\u002Fprint\u002Fipp\";\nimport { encodeNodeOFDPrintJob } from \"@quirekit\u002Fofd-editor\u002Fprint\u002Fnode\";\n\n\u002F**\n * Submits a validated batch to an operator-configured queue from Node.\n * @param printerUri - Printer URI from trusted server configuration.\n * @param job - Files, physical page selections, sides and copies approved by the user.\n * @param signal - Request lifetime.\n * @returns A receipt for querying queue status.\n *\u002F\nexport function submitToQueue(printerUri: string, job: OFDPrintJob, signal: AbortSignal) {\n  const queue = createOFDIPPPrintService({\n    label: \"Office\", printerUri, encode: encodeNodeOFDPrintJob,\n  });\n  return queue.submit(job, signal);\n}\n\n","ts",[102],{"type":95,"tag":19,"props":103,"children":104},{"__ignoreMap":66},[105,145,170,195,204,214,223,247,269,291,309,318,401,430,449,458,482],{"type":95,"tag":106,"props":107,"children":110},"span",{"class":108,"line":109},"line",1,[111,118,123,129,134,140],{"type":95,"tag":106,"props":112,"children":114},{"style":113},"--shiki-default:#D73A49;--shiki-light:#D73A49;--shiki-dark:#F97583",[115],{"type":116,"value":117},"text","import",{"type":95,"tag":106,"props":119,"children":120},{"style":113},[121],{"type":116,"value":122}," type",{"type":95,"tag":106,"props":124,"children":126},{"style":125},"--shiki-default:#24292E;--shiki-light:#24292E;--shiki-dark:#E1E4E8",[127],{"type":116,"value":128}," { OFDPrintJob } ",{"type":95,"tag":106,"props":130,"children":131},{"style":113},[132],{"type":116,"value":133},"from",{"type":95,"tag":106,"props":135,"children":137},{"style":136},"--shiki-default:#032F62;--shiki-light:#032F62;--shiki-dark:#9ECBFF",[138],{"type":116,"value":139}," \"@quirekit\u002Fofd-editor\u002Fprint\"",{"type":95,"tag":106,"props":141,"children":142},{"style":125},[143],{"type":116,"value":144},";\n",{"type":95,"tag":106,"props":146,"children":147},{"class":108,"line":67},[148,152,157,161,166],{"type":95,"tag":106,"props":149,"children":150},{"style":113},[151],{"type":116,"value":117},{"type":95,"tag":106,"props":153,"children":154},{"style":125},[155],{"type":116,"value":156}," { createOFDIPPPrintService } ",{"type":95,"tag":106,"props":158,"children":159},{"style":113},[160],{"type":116,"value":133},{"type":95,"tag":106,"props":162,"children":163},{"style":136},[164],{"type":116,"value":165}," \"@quirekit\u002Fofd-editor\u002Fprint\u002Fipp\"",{"type":95,"tag":106,"props":167,"children":168},{"style":125},[169],{"type":116,"value":144},{"type":95,"tag":106,"props":171,"children":172},{"class":108,"line":82},[173,177,182,186,191],{"type":95,"tag":106,"props":174,"children":175},{"style":113},[176],{"type":116,"value":117},{"type":95,"tag":106,"props":178,"children":179},{"style":125},[180],{"type":116,"value":181}," { encodeNodeOFDPrintJob } ",{"type":95,"tag":106,"props":183,"children":184},{"style":113},[185],{"type":116,"value":133},{"type":95,"tag":106,"props":187,"children":188},{"style":136},[189],{"type":116,"value":190}," \"@quirekit\u002Fofd-editor\u002Fprint\u002Fnode\"",{"type":95,"tag":106,"props":192,"children":193},{"style":125},[194],{"type":116,"value":144},{"type":95,"tag":106,"props":196,"children":198},{"class":108,"line":197},4,[199],{"type":95,"tag":106,"props":200,"children":201},{"emptyLinePlaceholder":81},[202],{"type":116,"value":203},"\n",{"type":95,"tag":106,"props":205,"children":207},{"class":108,"line":206},5,[208],{"type":95,"tag":106,"props":209,"children":211},{"style":210},"--shiki-default:#6A737D;--shiki-light:#6A737D;--shiki-dark:#6A737D",[212],{"type":116,"value":213},"\u002F**\n",{"type":95,"tag":106,"props":215,"children":217},{"class":108,"line":216},6,[218],{"type":95,"tag":106,"props":219,"children":220},{"style":210},[221],{"type":116,"value":222}," * Submits a validated batch to an operator-configured queue from Node.\n",{"type":95,"tag":106,"props":224,"children":226},{"class":108,"line":225},7,[227,232,237,242],{"type":95,"tag":106,"props":228,"children":229},{"style":210},[230],{"type":116,"value":231}," * ",{"type":95,"tag":106,"props":233,"children":234},{"style":113},[235],{"type":116,"value":236},"@param",{"type":95,"tag":106,"props":238,"children":239},{"style":125},[240],{"type":116,"value":241}," printerUri",{"type":95,"tag":106,"props":243,"children":244},{"style":210},[245],{"type":116,"value":246}," - Printer URI from trusted server configuration.\n",{"type":95,"tag":106,"props":248,"children":250},{"class":108,"line":249},8,[251,255,259,264],{"type":95,"tag":106,"props":252,"children":253},{"style":210},[254],{"type":116,"value":231},{"type":95,"tag":106,"props":256,"children":257},{"style":113},[258],{"type":116,"value":236},{"type":95,"tag":106,"props":260,"children":261},{"style":125},[262],{"type":116,"value":263}," job",{"type":95,"tag":106,"props":265,"children":266},{"style":210},[267],{"type":116,"value":268}," - Files, physical page selections, sides and copies approved by the user.\n",{"type":95,"tag":106,"props":270,"children":272},{"class":108,"line":271},9,[273,277,281,286],{"type":95,"tag":106,"props":274,"children":275},{"style":210},[276],{"type":116,"value":231},{"type":95,"tag":106,"props":278,"children":279},{"style":113},[280],{"type":116,"value":236},{"type":95,"tag":106,"props":282,"children":283},{"style":125},[284],{"type":116,"value":285}," signal",{"type":95,"tag":106,"props":287,"children":288},{"style":210},[289],{"type":116,"value":290}," - Request lifetime.\n",{"type":95,"tag":106,"props":292,"children":294},{"class":108,"line":293},10,[295,299,304],{"type":95,"tag":106,"props":296,"children":297},{"style":210},[298],{"type":116,"value":231},{"type":95,"tag":106,"props":300,"children":301},{"style":113},[302],{"type":116,"value":303},"@returns",{"type":95,"tag":106,"props":305,"children":306},{"style":210},[307],{"type":116,"value":308}," A receipt for querying queue status.\n",{"type":95,"tag":106,"props":310,"children":312},{"class":108,"line":311},11,[313],{"type":95,"tag":106,"props":314,"children":315},{"style":210},[316],{"type":116,"value":317}," *\u002F\n",{"type":95,"tag":106,"props":319,"children":321},{"class":108,"line":320},12,[322,327,332,338,343,349,354,360,364,369,373,378,382,387,391,396],{"type":95,"tag":106,"props":323,"children":324},{"style":113},[325],{"type":116,"value":326},"export",{"type":95,"tag":106,"props":328,"children":329},{"style":113},[330],{"type":116,"value":331}," function",{"type":95,"tag":106,"props":333,"children":335},{"style":334},"--shiki-default:#6F42C1;--shiki-light:#6F42C1;--shiki-dark:#B392F0",[336],{"type":116,"value":337}," submitToQueue",{"type":95,"tag":106,"props":339,"children":340},{"style":125},[341],{"type":116,"value":342},"(",{"type":95,"tag":106,"props":344,"children":346},{"style":345},"--shiki-default:#E36209;--shiki-light:#E36209;--shiki-dark:#FFAB70",[347],{"type":116,"value":348},"printerUri",{"type":95,"tag":106,"props":350,"children":351},{"style":113},[352],{"type":116,"value":353},":",{"type":95,"tag":106,"props":355,"children":357},{"style":356},"--shiki-default:#005CC5;--shiki-light:#005CC5;--shiki-dark:#79B8FF",[358],{"type":116,"value":359}," string",{"type":95,"tag":106,"props":361,"children":362},{"style":125},[363],{"type":116,"value":36},{"type":95,"tag":106,"props":365,"children":366},{"style":345},[367],{"type":116,"value":368},"job",{"type":95,"tag":106,"props":370,"children":371},{"style":113},[372],{"type":116,"value":353},{"type":95,"tag":106,"props":374,"children":375},{"style":334},[376],{"type":116,"value":377}," OFDPrintJob",{"type":95,"tag":106,"props":379,"children":380},{"style":125},[381],{"type":116,"value":36},{"type":95,"tag":106,"props":383,"children":384},{"style":345},[385],{"type":116,"value":386},"signal",{"type":95,"tag":106,"props":388,"children":389},{"style":113},[390],{"type":116,"value":353},{"type":95,"tag":106,"props":392,"children":393},{"style":334},[394],{"type":116,"value":395}," AbortSignal",{"type":95,"tag":106,"props":397,"children":398},{"style":125},[399],{"type":116,"value":400},") {\n",{"type":95,"tag":106,"props":402,"children":404},{"class":108,"line":403},13,[405,410,415,420,425],{"type":95,"tag":106,"props":406,"children":407},{"style":113},[408],{"type":116,"value":409},"  const",{"type":95,"tag":106,"props":411,"children":412},{"style":356},[413],{"type":116,"value":414}," queue",{"type":95,"tag":106,"props":416,"children":417},{"style":113},[418],{"type":116,"value":419}," =",{"type":95,"tag":106,"props":421,"children":422},{"style":334},[423],{"type":116,"value":424}," createOFDIPPPrintService",{"type":95,"tag":106,"props":426,"children":427},{"style":125},[428],{"type":116,"value":429},"({\n",{"type":95,"tag":106,"props":431,"children":433},{"class":108,"line":432},14,[434,439,444],{"type":95,"tag":106,"props":435,"children":436},{"style":125},[437],{"type":116,"value":438},"    label: ",{"type":95,"tag":106,"props":440,"children":441},{"style":136},[442],{"type":116,"value":443},"\"Office\"",{"type":95,"tag":106,"props":445,"children":446},{"style":125},[447],{"type":116,"value":448},", printerUri, encode: encodeNodeOFDPrintJob,\n",{"type":95,"tag":106,"props":450,"children":452},{"class":108,"line":451},15,[453],{"type":95,"tag":106,"props":454,"children":455},{"style":125},[456],{"type":116,"value":457},"  });\n",{"type":95,"tag":106,"props":459,"children":461},{"class":108,"line":460},16,[462,467,472,477],{"type":95,"tag":106,"props":463,"children":464},{"style":113},[465],{"type":116,"value":466},"  return",{"type":95,"tag":106,"props":468,"children":469},{"style":125},[470],{"type":116,"value":471}," queue.",{"type":95,"tag":106,"props":473,"children":474},{"style":334},[475],{"type":116,"value":476},"submit",{"type":95,"tag":106,"props":478,"children":479},{"style":125},[480],{"type":116,"value":481},"(job, signal);\n",{"type":95,"tag":106,"props":483,"children":485},{"class":108,"line":484},17,[486],{"type":95,"tag":106,"props":487,"children":488},{"style":125},[489],{"type":116,"value":490},"}\n",{"type":95,"tag":492,"props":493,"children":494},"style",{},[495],{"type":116,"value":496},"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 .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 .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);}",1795456058633]