mirror of
https://github.com/anthropics/skills.git
synced 2026-08-02 21:15:27 +08:00
Update docx, xlsx, pdf, pptx skills with latest improvements
docx: Add commenting and track-changes support. Reorganize OOXML tooling into a shared office/ module. pptx: Streamline SKILL.md, add slide-editing and pptxgenjs guides, bundle html2pptx as a tgz. Reorganize OOXML tooling into a shared office/ module. xlsx: Move recalc script into scripts/ and expand it. Add shared office/ module for OOXML pack/unpack/validate. pdf: Improve form-filling workflow with new form-structure extraction script and updated field-info extraction.
This commit is contained in:
@@ -4,12 +4,9 @@ import sys
|
||||
from PIL import Image, ImageDraw
|
||||
|
||||
|
||||
# Creates "validation" images with rectangles for the bounding box information that
|
||||
# Claude creates when determining where to add text annotations in PDFs. See forms.md.
|
||||
|
||||
|
||||
def create_validation_image(page_number, fields_json_path, input_path, output_path):
|
||||
# Input file should be in the `fields.json` format described in forms.md.
|
||||
with open(fields_json_path, 'r') as f:
|
||||
data = json.load(f)
|
||||
|
||||
@@ -21,7 +18,6 @@ def create_validation_image(page_number, fields_json_path, input_path, output_pa
|
||||
if field["page_number"] == page_number:
|
||||
entry_box = field['entry_bounding_box']
|
||||
label_box = field['label_bounding_box']
|
||||
# Draw red rectangle over entry bounding box and blue rectangle over the label.
|
||||
draw.rectangle(entry_box, outline='red', width=2)
|
||||
draw.rectangle(label_box, outline='blue', width=2)
|
||||
num_boxes += 2
|
||||
|
||||
Reference in New Issue
Block a user