agentsclimarketplace

Australia customs excel to pdf

Skill xuluoforcainiao/australia-customs-excel-to-pdf/australia-customs-excel-to-pdf

Convert Australian customs/ logistics commercial invoice Excel files (.xlsx) into a single-page landscape A4 PDF. Use when the user needs to convert Excel invoices to PDF format, especially for Australian customs clearance documents from Top Logistics, Cainiao, 4PX, or similar freight forwarders. Handles embedded product images and preserves the standard commercial invoice layout.From its SKILL.md

Install
npx -y skills add xuluoforcainiao/australia-customs-excel-to-pdf --skill australia-customs-excel-to-pdf

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

3.3 KB, 776 tokens by cl100k_base, as published. Nobody here has run it

Australia Customs Excel to PDF

Purpose

Convert Excel commercial invoice files (typically from Australian logistics providers) into a single-page, landscape A4 PDF with a professional layout matching standard customs documentation formats.

When to Use

  • User asks to convert an Excel invoice to PDF
  • Working with Australian customs or freight forwarding documents
  • Files contain product images that need to be preserved in the PDF
  • Need a single-page landscape A4 output for printing or submission

Requirements

  • Python 3.7+ with openpyxl and reportlab installed
  • CJK font support (Microsoft YaHei on Windows, PingFang on macOS)

Workflow

Step 1: Verify Dependencies

Ensure required packages are available:

python -m pip install openpyxl reportlab

Step 2: Run the Conversion Script

python scripts/excel_to_pdf.py <input.xlsx> <output.pdf>

Step 3: Manual Fallback (if script fails)

If the script cannot be executed, generate the PDF manually following this layout:

  1. Page setup: Landscape A4 (29.7cm x 21cm)
  2. Outer border: 1.5pt black rectangle with 2cm margins
  3. Header (red, centered):
    • Company name from cell D1
    • Address from cell D2
    • Horizontal line separator
  4. Title: "COMMERCIAL INVOICE" centered, 13pt
  5. Consignee (left): From cell E4, label "Consignee :" in black, name in red
  6. Right info block (aligned with underlines):
    • DATE: from J4
    • INVOICE NO.: from J5
    • TRADE TERM: from J6
    • PORT OF LOADING: from J7
    • DESTINATION: from J8
  7. Table (grey header, full borders, 7 columns):
    • BUYER P.O. NO. | Package | Quantity | DESCRIPTION OF GOODS | Products' Material | UNIT PRICE (AUD) | TOTAL AMOUNT (AUD)
    • Data from row 10
    • GRAND TOTAL from row 11
  8. WEB: URL from E12 in blue
  9. Product image: Extract from Excel zip (xl/media/) and place below WEB line

Step 4: Image Extraction

To extract embedded images from the Excel file manually:

import zipfile
z = zipfile.ZipFile('input.xlsx')
for name in z.namelist():
    if name.startswith('xl/media/') and not name.endswith('/'):
        data = z.read(name)
        with open(name.split('/')[-1], 'wb') as f:
            f.write(data)

Expected Excel Structure

The skill assumes a standard layout commonly used by Australian freight forwarders:

ContentTypical Cell
Company nameD1
Company addressD2
Consignee nameE4
DateJ4
Invoice No.J5
Trade TermJ6
Port of LoadingJ7
DestinationJ8
Table headerD9:J9
Product dataD10:J10
Grand totalD11:J11
WEB URLE12
Product imageEmbedded in xl/media/

Output Format

  • Single page, landscape A4
  • Outer border frame
  • Red company header text
  • Grey table header background
  • Complete table borders (horizontal and vertical lines)
  • Blue WEB link text
  • Preserved product image

What ships with it: 2 files

9.0 KB alongside SKILL.md, 1 of them executable

scripts/

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.