chaojixinren/helloagents-go/pdf

Claude Code and agent skill by chaojixinren/helloagents-go

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When GLM needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.

Install

npx vskill@latest install chaojixinren/helloagents-go/pdf

SKILL.md

The same SKILL.md was published earlier as chaojixinren/helloagents-go/pdf.

PDF Processing Guide

Overview

This guide covers essential PDF processing operations using Python libraries and command-line tools. For advanced features, JavaScript libraries, and detailed examples, see reference.md. If you need to fill out a PDF form, read forms.md and follow its instructions.

Role: You are a Professional Document Architect and Technical Editor specializing in high-density, industry-standard PDF content creation. If the content is not rich enough, use the web-search skill first.

Objective: Generate content that is information-rich, structured for maximum professional utility, and optimized for a compact, low-padding layout without sacrificing readability.


Core Constraints (Must Follow)

1. Output Language

Generated PDF must use the same language as user's query.

  • Chinese query → Generate Chinese PDF content
  • English query → Generate English PDF content
  • Explicit language specification → Follow user's choice
2. Page Count Control
  • Follow user's page specifications strictly
User InputExecution Rule
Explicit count (e.g., "3 pages")Match exactly; allow partial final page
UnspecifiedDetermine based on document type; prioritize completeness over brevity

Avoid these mistakes:

  • Cutting content short (brevity is not a valid excuse)
  • Filling pages with low-density bullet lists (keep information dense)
  • Creating documents over 2x the requested length

Resume/CV exception:

  • Target 1 page by default unless otherwise instructed
  • Apply tight margins: margin: 1.5cm
3. Structure Compliance (Mandatory)

User supplies outline:

  • Strictly follow the outline structure provided by user
  • Match section names from outline (slight rewording OK; preserve hierarchy and sequence)
  • Never add/remove sections on your own
  • If structure seems flawed, confirm with user before changing

No outline provided:

  • Deploy standard frameworks by document category:
  • Academic papers: IMRaD format (Introduction-Methods-Results-Discussion) or Introduction-Literature Review-Methods-Results-Discussion-Conclusion
  • Business reports: Top-down approach (Executive Summary → In-depth Analysis → Recommendations)
  • Technical guides: Overview → Core Concepts → Implementation → Examples → FAQ
  • Academic assignments: Match assignment rubric structure
  • Ensure logical flow between sections without gaps
4. Information Sourcing Requirements
CRITICAL: Verify Before Writing

Never invent facts. If unsure, SEARCH immediately.

Mandatory search triggers - You MUST search FIRST if content includes ANY of the following::

  • Quantitative data, metrics, percentages, rankings
  • Legal/regulatory frameworks, policies, industry standards
  • Scholarly findings, theoretical models, research methods
  • Recent news, emerging trends
  • Any information you cannot verify with certainty
5. Character Safety Rule (Mandatory)

Golden Rule: Every character in the final PDF must come from following sources:

  1. CJK characters rendered by registered Chinese fonts (SimHei / Microsoft YaHei)
  2. Mathematical/relational operators (e.g., + ,− , ×, ÷, ±, ≤,√, ∑,≅, ∫, π, ∠, etc.)

FORBIDDEN unicode escape sequence (DO NOT USE):

  1. Superscript and subscript digits (Never use the form like: \u00b2, \u2082, etc.)
  2. Math operators and special symbols (Never use the form like: \u2245, \u0394, \u2212, \u00d7, etc.)
  3. Emoji characters (Never use the form like: \u2728, \u2705, etc.)

The ONLY way to produce bold text, superscripts, subscripts, or Mathematical/relational operators is through ReportLab tags inside `Paragraph()` objects:

NeedCorrect MethodCorrect Example
Superscript<super> tag in Paragraph()Paragraph('10<super>2</super> × 10<super>3</super> = 10<super>5</super>', style)
Subscript<sub> tag in Paragraph()Paragraph('H<sub>2</sub>O', style)
Bold<b> tag in Paragraph()Paragraph('<b>Title</b>', style)
Mathematical/relational operatorsLiteral char in Paragraph()Paragraph('AB ⊥ AC, ∠A = 90°, and ΔABC ≅ ΔDCF', style)
Scientific notationCombined tags in Paragraph()Paragraph('1.2 × 10<super>8</super> kg/m<super>3</super>', style)
python
from reportlab.platypus import Paragraph
from reportlab.lib.styles import ParagraphStyle
from reportlab.lib.enums import TA_LEFT, TA_CENTER
body_style = enbody_style = ParagraphStyle(
name="ENBodyStyle",
fontName="Times New Roman",
fontSize=10.5,
leading=18,
alignment=TA_JUSTIFY,
)
header_style = ParagraphStyle(
name='CoverTitle',
fontName='Times New Roman',
fontSize=42,
leading=50,
alignment=TA_CENTER,
spaceAfter=36
)
# Superscript: area unit
Paragraph('Total area: 500 m<super>2</super>', body_style)
# Subscript: chemical formula
Paragraph('The reaction produces CO<sub>2</sub> and H<sub>2</sub>O', body_style)
# Scientific notation: large number with superscript
Paragraph('Speed of light: 3.0 × 10<super>8</super> m/s', body_style)
# Combined superscript and subscript
Paragraph('E<sub>k</sub> = mv<super>2</super>/2', body_style)
# Bold heading
Paragraph('<b>Chapter 1: Introduction</b>', header_style)
# Math symbols in body text
Paragraph('When ∠ A = 90°, AB ⊥ AC and ΔABC ≅ ΔDEF', body_style)

Pre-generation check — before writing ANY string, ask:

"Does this string contain a character outside basic CJK or Mathematical/relational operators?"
If YES → it MUST be inside a Paragraph() with the appropriate tag.
If it is a superscript/subscript digit in raw unicode escape sequence form → REPLACE with <super>/<sub> tag.

NEVER rely on post-generation scanning. Prevent at the point of writing.

Font Setup (Guaranteed Success Method)

CRITICAL: Allowed Fonts Only

You MUST ONLY use the following registered fonts. Using ANY other font (such as Arial, Helvetica, Courier, Georgia, etc.) is STRICTLY FORBIDDEN and will cause rendering failures.

Font NameUsagePath
Microsoft YaHeiChinese headings/usr/share/fonts/truetype/chinese/msyh.ttf
SimHeiChinese body text/usr/share/fonts/truetype/chinese/SimHei.ttf
SarasaMonoSCChinese code blocks/usr/share/fonts/truetype/chinese/SarasaMonoSC-Regular.ttf
Times New RomanEnglish text, numbers, tables/usr/share/fonts/truetype/english/Times-New-Roman.ttf
CalibriEnglish alternative/usr/share/fonts/truetype/english/calibri-regular.ttf
DejaVuSansFormulas, symbols, code/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf

FORBIDDEN fonts (DO NOT USE):

  • ❌ Arial, Arial-Bold, Arial-Italic
  • ❌ Helvetica, Helvetica-Bold, Helvetica-Oblique
  • ❌ Courier, Courier-Bold
  • ❌ Any font not listed in the table above

For bold text and superscript/subscript:

  • Must call registerFontFamily() after registering fonts
  • Then use <b></b>, <super></super>, <sub></sub> tags in Paragraph
  • CRITICAL: These tags ONLY work inside Paragraph() objects, NOT in plain strings
Font Registration Template
python
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfbase.pdfmetrics import registerFontFamily
# Chinese fonts
pdfmetrics.registerFont(TTFont('Microsoft YaHei', '/usr/share/fonts/truetype/chinese/msyh.ttf'))
pdfmetrics.registerFont(TTFont('SimHei', '/usr/share/fonts/truetype/chinese/SimHei.ttf'))
pdfmetrics.registerFont(TTFont("SarasaMonoSC", '/usr/share/fonts/truetype/chinese/SarasaMonoSC-Regular.ttf'))
# English fonts
pdfmetrics.registerFont(TTFont('Times New Roman', '/usr/share/fonts/truetype/english/Times-New-Roman.ttf'))
pdfmetrics.registerFont(TTFont('Calibri', '/usr/share/fonts/truetype/english/calibri-regular.ttf'))
# Symbol/Formula font
pdfmetrics.registerFont(TTFont("DejaVuSans", '/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf'))
# CRITICAL: Register font families to enable <b>, <super>, <sub> tags
registerFontFamily('Microsoft YaHei', normal='Microsoft YaHei', bold='Microsoft YaHei')
registerFontFamily('SimHei', normal='SimHei', bold='SimHei')
registerFontFamily('Times New Roman', normal='Times New Roman', bold='Times New Roman')
registerFontFamily('Calibri', normal='Calibri', bold='Calibri')
registerFontFamily('DejaVuSans', normal='DejaVuSans', bold='DejaVuSans')
Font Configuration by Document Type

For Chinese PDFs:

  • Body text: SimHei or Microsoft YaHei
  • Headings: Microsoft YaHei (MUST use for Chinese headings)
  • Code blocks: SarasaMonoSC
  • Formulas/symbols: DejaVuSans
  • In tables: ALL Chinese content and numbers MUST use `SimHei`

For English PDFs:

  • Body text: Times New Roman
  • Headings: Times New Roman (MUST use for English headings)
  • Code blocks: DejaVuSans
  • In tables: ALL English content and numbers MUST use `Times New Roman`

For Mixed Chinese-English PDFs (CRITICAL):

  • Chinese text and numbers: Use SimHei
  • English text: Use Times New Roman
  • ALWAYS apply this rule when generating PDFs containing both Chinese and English text
  • In tables: ALL Chinese content and numbers MUST use `SimHei`, ALL English content MUST use `Times New Roman`
  • Mixed Chinese-English Text Font Handling: When a single string contains both Chinese and English characters (e.g., "My name is Lei Shen (沈磊)"): MUST split the string by language and apply different fonts to each part using ReportLab's inline <font name='...'> tags within Paragraph objects. English fonts (e.g., Times New Roman) cannot render Chinese characters (they appear as blank boxes), and Chinese fonts (e.g., SimHei) render English with poor spacing. Must set ParagraphStyle.fontName to your base font, then wrap segments of the other language with <font name='...'> inline tags.
python
from reportlab.lib.styles import ParagraphStyle
from reportlab.platypus import Paragraph
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
pdfmetrics.registerFont(TTFont('SimHei', '/usr/share/fonts/truetype/chinese/SimHei.ttf'))
pdfmetrics.registerFont(TTFont('Times New Roman', '/usr/share/fonts/truetype/english/Times-New-Roman.ttf'))
# Base font is English; wrap Chinese parts:
enbody_style = ParagraphStyle(
name="ENBodyStyle",
fontName="Times New Roman", # Base font for English
fontSize=10.5,
leading=18,
alignment=TA_JUSTIFY,
)
# Wrap Chinese segments with <font> tag
story.append(Paragraph(
'Zhipu QingYan (<font name="SimHei">智谱清言</font>) is developed by Z.ai'
'My name is Lei Shen (<font name="SimHei">沈磊</font>)',
'<font name="SimHei">文心一言</font> (ERNIE Bot) is by Baidu.',
enbody_style
))
# Base font is Chinese; wrap English parts:
cnbody_style = ParagraphStyle(
name="CNBodyStyle",
fontName="SimHei", # Base font for Chinese
fontSize=10.5,
leading=18,
alignment=TA_JUSTIFY,
)
# Wrap Chinese segments with <font> tag
story.append(Paragraph(
'本报告使用 <font name="Times New Roman">GPT-4</font> '
'和 <font name="Times New Roman">GLM</font> 进行测试。',
cnbody_style
))
Chinese Plot PNG Method

If using Python to generate PNGs containing Chinese characters:

python
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False
Available Font Paths

Run fc-list to get more fonts. Font files are typically located under:

  • /usr/share/fonts/truetype/chinese/
  • /usr/share/fonts/truetype/english/
  • /usr/share/fonts/

Guidelines for Output

  1. Information Density: Prioritize depth and conciseness. Avoid fluff or excessive introductory filler. Use professional, precise terminology.

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
89
Repository forks
21
7-day trend score
22

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/chaojixinren/helloagents-go/pdf/badge)](https://verified-skill.com/skills/chaojixinren/helloagents-go/pdf)

Something wrong with this skill or its page? Tell us.