package com.vetti.common.utils;

public class MarkdownToPdfExample {

    public static void main(String[] args) throws Exception {
        String markdown = "markdown\n" +
                "# ACE AMIO\n" +
                "\n" +
                "## Personal Information\n" +
                "- **Phone**: (+61) 475 185 310\n" +
                "- **Email**: ecaamio@gmail.com\n" +
                "- **Address**: Marsden Park, New South Wales 2765\n" +
                "\n" +
                "## Professional Summary\n" +
                "Experienced Quantity Surveyor with over 20 years in the construction and engineering industry, skilled in cost estimation, procurement, and project management. Proven ability to liaise effectively with clients, subcontractors, and suppliers to ensure project success. Proficient in using industry-standard software tools and a strong understanding of construction processes.\n" +
                "\n" +
                "## Work Experience\n" +
                "\n" +
                "### Quantity Surveyor (Pre-Contracts Team) | Ertech Pty Ltd\n" +
                "**Employment Period**: April 2023 – December 2024\n" +
                "- Prepared procurement lists, Request for Quotation letters, and tender documents to streamline project initiation.\n" +
                "- Liaised with suppliers and subcontractors for quotations using Oracle Preconstruction and OneDrive, enhancing procurement efficiency.\n" +
                "- Accurately measured quantities using Bluebeam, ensuring precise project estimations.\n" +
                "- Assisted the project team in Cost to Completion tasks, contributing to budget adherence.\n" +
                "- Maintained a comprehensive directory of suppliers and subcontractors, improving sourcing efficiency.\n" +
                "\n" +
                "### Estimator (Cost Engineering Team) | MIEngineers (Leckring Pty Ltd)\n" +
                "**Employment Period**: December 2017 – March 2023\n" +
                "- Communicated with suppliers and subcontractors for materials quotations, comparing and analyzing tenders to identify the best value options.\n" +
                "- Engaged with clients for additional information and clarification, ensuring all project requirements were met.\n" +
                "- Measured quantities accurately using On-Screen Takeoff and Bluebeam, supporting detailed costing.\n" +
                "- Determined pay items and prepared a Schedule of Rates, facilitating clear financial planning.\n" +
                "- Developed first principles estimates using Benchmark Estimating Software, enhancing accuracy in financial proposals.\n" +
                "\n" +
                "### Senior Quantity Surveyor (Project / Site Team) | BEWG International Pte. Ltd.\n" +
                "**Employment Period**: May 2015 – June 2016\n" +
                "- Liaised with subcontractors for quotations, analyzed tenders, and conducted interviews, driving competitive pricing.\n" +
                "- Prepared evaluation forms for subcontractors, ensuring compliance with project standards and management approval.\n" +
                "- Developed subcontract documents, including bills of quantities, to clarify project expectations.\n" +
                "- Conducted site visits to monitor work progress and ensure alignment with project schedules.\n" +
                "- Verified the accuracy of EPC contractor and subcontractor payment applications, maintaining financial integrity.\n" +
                "\n" +
                "### Quantity Surveyor (Project / Site Team) | Koh Brothers Building & Civil Engineering Contractor (Pte.) Ltd\n" +
                "**Employment Period**: June 2010 – August 2014\n" +
                "- Coordinated with subcontractors for quotations and analyzed tenders, streamlining procurement processes.\n" +
                "- Prepared evaluation forms for subcontractors, supporting informed decision-making.\n" +
                "- Developed subcontract documents, including bills of quantities, to facilitate project execution.\n" +
                "- Regularly visited sites to communicate with the site team and monitor subcontract performance.\n" +
                "\n" +
                "### Quantity Surveyor (Project / Site Team) | Shimizu Corporation\n" +
                "**Employment Period**: June 2007 – June 2008\n" +
                "- Liaised with subcontractors for quotations and analyzed tenders to ensure competitive pricing.\n" +
                "- Collaborated with the planning department and subcontractors for necessary drawings, supporting project clarity.\n" +
                "- Conducted daily site visits to monitor progress and maintain communication with the site team.\n" +
                "- Prepared and submitted progress and variation claims, ensuring accurate financial reporting.\n" +
                "\n" +
                "### Quantity Surveyor (Building Materials Group Tender Department) | Hong Leong Asia Ltd\n" +
                "**Employment Period**: March 2006 – June 2007\n" +
                "- Engaged with clients to gather necessary project documents, ensuring all requirements were addressed.\n" +
                "- Measured quantities for individual projects, providing accurate estimates for bidding.\n" +
                "- Prepared client quotations and verified quantities for projects nearing completion, ensuring financial accuracy.\n" +
                "\n" +
                "### Site Engineer cum Quantity Surveyor | Floor Finish – Floor Level (FF-FL), Inc.\n" +
                "**Employment Period**: August 2003 – December 2005\n" +
                "- Supervised civil and structural works, ensuring adherence to project specifications.\n" +
                "- Prepared activity reports and site diaries to document progress.\n" +
                "- Coordinated with the main contractor to align project activities.\n" +
                "\n" +
                "## Education\n" +
                "\n" +
                "### Bachelor of Science in Civil Engineering | Mapua Institute of Technology, Philippines\n" +
                "**Graduation Date**: March 2002\n" +
                "\n" +
                "## Skills & Certifications\n" +
                "\n" +
                "### Professional Skills\n" +
                "- Microsoft Office: Advanced\n" +
                "- MS Project: Advanced\n" +
                "- Primavera 6.0: Intermediate\n" +
                "- AutoCAD: Intermediate\n" +
                "- Adobe Acrobat: Advanced\n" +
                "- Bluebeam: Advanced\n" +
                "- On-Screen Takeoff: Advanced\n" +
                "- Benchmark Estimating Software: Advanced\n" +
                "- COINS: Intermediate\n" +
                "- Xero: Intermediate\n" +
                "- 12d Model: Intermediate\n" +
                "- OpenRoads Designer: Intermediate\n" +
                "- Foxit: Advanced\n" +
                "\n" +
                "### Professional Certifications\n" +
                "- General Safety Induction Course – White Card (TAFE Queensland, Australia) | February 2017\n" +
                "- CostX 6.0 Introductory Training (Exactal Technologies Pty Ltd, Australia) | October 2016\n" +
                "\n" +
                "## Additional Information\n" +
                "\n" +
                "### Professional Affiliations\n" +
                "- Australian Cost Engineering Society | 2022 – Present\n" +
                "- Registered Professional Civil Engineer (Philippines) | 2003 – Present\n" +
                "- Philippine Institute of Civil Engineers | 2000 – Present\n" +
                "\n" +
                "### References\n" +
                "- **Sri Somanchi**  \n" +
                "  Position: Business Development Manager  \n" +
                "  Company: Abergeldie Complex Infrastructure  \n" +
                "  Phone: (+61) 413 334 849  \n" +
                "  Address: 5 George Young Street, Regents Park NSW 2143  \n" +
                "\n" +
                "- **Jensen Enriquez**  \n" +
                "  Position: Senior Estimator  \n" +
                "  Company: Melhem Civil Pty Ltd  \n" +
                "  Phone: (+61) 420 395 454  \n" +
                "  Address: 4/18-30 Pindari Road, Peakhurst Heights NSW 2210  ";

        String html = MarkdownUtil.markdownToHtml(markdown);

        // 可注入 CSS
        html = """
                <html>
                <head>
                    <style>
                        body { font-family: SimSun; }
                        h1 { color: #2c3e50; }
                    </style>
                </head>
                <body>
                """ + html + """
                </body>
                </html>
                """;

        HtmlToPdfUtil.htmlToPdf(html, "/Users/wangxiangshun/Desktop/临时文件/110/output.pdf");
    }
}

