[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ACPM1YT035V0A5RGQXP9AB":3,"skill-same:01M6ACPM1YT035V0A5RGQXP9AB":62},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":25,"linkOnly":26,"markdownContent":27,"markdownBody":27,"frontMatter":28,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":36,"ownerDescription":6,"updatedAt":37,"install":38,"resources":51},"01M6ACPM1YT035V0A5RGQXP9AB","manage-pdf-export",null,"apache\u002Fofbiz-plugins","apache","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F47359?v=4","01M6AC83E6K4FDKK7HZ8WNMQKE","The Apache Software Foundation","01M6ACMJJ1Q4WYATY4GXZ2FAVD",178,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-pdf-export\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",[23,24],"PDF","manage pdf export","2026-11-10 10:12:30",false,"\u003C!--\nLicensed to the Apache Software Foundation (ASF) under one\nor more contributor license agreements.  See the NOTICE file\ndistributed with this work for additional information\nregarding copyright ownership.  The ASF licenses this file\nto you under the Apache License, Version 2.0 (the\n\"License\"); you may not use this file except in compliance\nwith the License.  You may obtain a copy of the License at\n\nhttp:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the License is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied.  See the License for the\nspecific language governing permissions and limitations\nunder the License.\n-->\n\n---\nname: manage-pdf-export\ndescription: Guidelines for generating printable PDF documents in OFBiz using Apache FOP (XSL-FO).\n---\n\n# Skill: manage-pdf-export\n\n## Goal\nDesign and implement professional printable documents (e.g., invoices, packing slips) using Apache FOP (XSL-FO) for PDF generation.\n\n## Triggers\n**ALWAYS** read this skill when:\n- Creating printable business documents.\n- Implementing report-specific screen definitions for PDF output.\n- Converting HTML\u002FFTL templates to XSL-FO.\n\n## Use when\n- Generating legal or formal documents (PDF).\n- Batch printing operations.\n- **NOT** for data dumps (CSV\u002FExcel) - use a separate data export skill.\n\n## Procedure\n1.  **Output Format**:\n    - `application\u002Fpdf` (Apache FOP): The standard for printable documents with strict layout requirements.\n\n2.  **Data Preparation (Groovy\u002FJava)**:\n    - Create a dedicated service or groovy script to fetch document data.\n    - **Optimization**: Use `EntityListIterator` if the document contains large lists.\n    - **Structure**: Nested maps\u002Flists are best for Master-Detail PDFs (e.g., Header + Items).\n\n3.  **Template Design (XSL-FO via FTL)**:\n    - Use FreeMarker to inject dynamic data into XSL-FO tags.\n    - **Root**: `\u003Cfo:root>`\n    - **Layout**: `\u003Cfo:layout-master-set>` defining `simple-page-master` (A4, Letter).\n    - **Content**: `\u003Cfo:page-sequence>` containing `\u003Cfo:flow flow-name=\"xsl-region-body\">`.\n    - **Tables**: Use `\u003Cfo:table>` and `\u003Cfo:table-row>` for structured data.\n    - **Example Loop**:\n      ```xml\n      \u003C#list orderItems as item>\n        \u003Cfo:table-row>\n            \u003Cfo:table-cell>\u003Cfo:block>${item.description}\u003C\u002Ffo:block>\u003C\u002Ffo:table-cell>\n        \u003C\u002Ffo:table-row>\n      \u003C\u002F#list>\n      ```\n\n4.  **Screen Definition**:\n    - Define a screen in `widget\u002FCommonScreens.xml` or component-specific screen file.\n    - Use `xsl-fo` as the render-mode\u002Fcontent-type.\n    ```xml\n    \u003Cscreen name=\"OrderPdf\">\n        \u003Csection>\n            \u003Cactions>\n                \u003Cscript location=\"component:\u002F\u002Fmycomponent\u002FgroovyScripts\u002Fdocuments\u002FOrderPdf.groovy\"\u002F>\n            \u003C\u002Factions>\n            \u003Cwidgets>\n                \u003Cplatform-specific>\n                    \u003Cxsl-fo>\u003Chtml-template location=\"component:\u002F\u002Fmycomponent\u002Ftemplate\u002Fdocuments\u002FOrderPdf.fo.ftl\"\u002F>\u003C\u002Fxsl-fo>\n                \u003C\u002Fplatform-specific>\n            \u003C\u002Fwidgets>\n        \u003C\u002Fsection>\n    \u003C\u002Fscreen>\n    ```\n\n5.  **View Mapping (`controller.xml`)**:\n    - Map the request to the screen with type `screenfop`.\n    ```xml\n    \u003Cview-map name=\"OrderPdf\" type=\"screenfop\" page=\"component:\u002F\u002Fmycomponent\u002Fwidget\u002FOrderScreens.xml#OrderPdf\" content-type=\"application\u002Fpdf\" encoding=\"none\"\u002F>\n    ```\n\n## Guardrails\n- **Styling**: Styles in FO are verbose. Use FTL macros for common elements (headers, footers) to ensure consistency across documents.\n- **Fonts**: Ensure required fonts are available in the FOP configuration if using non-standard typefaces.\n- **Async**: For very large documents, generate them asynchronously via Job Scheduler and email the result.\n- **Security**: Ensure strict permission checks (`security.hasEntityPermission`) in the data preparation phase, as PDF generation often bypasses standard UI filters.\n\n## Examples\n**Example: XSL-FO Template Structure**\n```xml\n\u003Cfo:root xmlns:fo=\"http:\u002F\u002Fwww.w3.org\u002F1999\u002FXSL\u002FFormat\">\n    \u003Cfo:layout-master-set>\n        \u003Cfo:simple-page-master master-name=\"main\" page-height=\"11in\" page-width=\"8.5in\"\n            margin-top=\"0.5in\" margin-bottom=\"0.5in\" margin-left=\"0.5in\" margin-right=\"0.5in\">\n            \u003Cfo:region-body margin-top=\"1in\"\u002F>\n            \u003Cfo:region-before extent=\"1in\"\u002F>\n            \u003Cfo:region-after extent=\"1in\"\u002F>\n        \u003C\u002Ffo:simple-page-master>\n    \u003C\u002Ffo:layout-master-set>\n\n    \u003Cfo:page-sequence master-reference=\"main\">\n        \u003Cfo:flow flow-name=\"xsl-region-body\">\n            \u003Cfo:block font-size=\"18pt\" font-weight=\"bold\" text-align=\"center\">\n                Order Document: ${orderHeader.orderId}\n            \u003C\u002Ffo:block>\n            \u003Cfo:table table-layout=\"fixed\" width=\"100%\">\n                \u003Cfo:table-column column-width=\"50%\"\u002F>\n                \u003Cfo:table-column column-width=\"50%\"\u002F>\n                \u003Cfo:table-body>\n                    \u003C#list orderItems as item>\n                    \u003Cfo:table-row>\n                        \u003Cfo:table-cell>\u003Cfo:block>${item.description}\u003C\u002Ffo:block>\u003C\u002Ffo:table-cell>\n                        \u003Cfo:table-cell>\u003Cfo:block>${item.unitPrice}\u003C\u002Ffo:block>\u003C\u002Ffo:table-cell>\n                    \u003C\u002Ffo:table-row>\n                    \u003C\u002F#list>\n                \u003C\u002Ffo:table-body>\n            \u003C\u002Ffo:table>\n        \u003C\u002Ffo:flow>\n    \u003C\u002Ffo:page-sequence>\n\u003C\u002Ffo:root>\n```\n",{},"trunk","6c6c27710443de03e9247605d33a2e2f5bc3d1e2","ai-agent-skills\u002Fmanage-pdf-export",222,"https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins","https:\u002F\u002Fofbiz.apache.org\u002F","https:\u002F\u002Fgithub.com\u002Fapache","https:\u002F\u002Fwww.apache.org\u002F","2026-11-12 00:54:27",{"source":7,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add apache\u002Fofbiz-plugins --skill manage-pdf-export",{"tool":44,"command":45},"bunx","bunx skills add apache\u002Fofbiz-plugins --skill manage-pdf-export",{"tool":47,"command":48},"pnpm","pnpm dlx skills add apache\u002Fofbiz-plugins --skill manage-pdf-export","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-pdf-export\u002FSKILL.md",true,[52,58],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"evals\u002Fevals.json","REFERENCE","参考文档",6833,"https:\u002F\u002Fgithub.com\u002FJetBrains\u002Fintellij-community\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fyoutrack-community\u002Fevals\u002Fevals.json",{"path":59,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fcli-reference.md",10321,"https:\u002F\u002Fgithub.com\u002FJetBrains\u002Fintellij-community\u002Fblob\u002Fmaster\u002F.claude\u002Fskills\u002Fyoutrack-community\u002Freferences\u002Fcli-reference.md",[63,70,77,84,91,98],{"skillNo":64,"name":65,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":25},"01M6ACQSN90YKJZ92MQ52D9R8H","prepush-readiness","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fprepush-readiness\u002FSKILL.md",[],[69],"prepush readiness",{"skillNo":71,"name":72,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":25},"01M6ACQPR1WRA751V4DXVC3AHF","manage-webapps","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-webapps\u002FSKILL.md",[],[76],"manage webapps",{"skillNo":78,"name":79,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":25},"01M6ACQMCX8Z7NY2CE08NCV6ND","manage-themes","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-themes\u002FSKILL.md",[],[83],"manage themes",{"skillNo":85,"name":86,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":25},"01M6ACQHYN20AFWF6TKK4RGQ8A","manage-tests","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-tests\u002FSKILL.md",[],[90],"manage tests",{"skillNo":92,"name":93,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":25},"01M6ACQFRMW7R45YD3HRAXPGWF","manage-templates","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-templates\u002FSKILL.md",[],[97],"manage templates",{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":25},"01M6ACQCSSDZQMD8VX2K3WRR93","manage-strategies","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-strategies\u002FSKILL.md",[],[104],"manage strategies"]