Use Case 1: dumping to and loading from YAML

The idea is to extract something from an AFP file, dump it into the (human-readable) yaml format, edit the values in the yaml and load it back to an AFP file.

First you need to extract what you need from an AFP (you could of course skip this step and dump the whole AFP file to a yaml but this will of course generate a huge output).

Use for example afp_extract_resources.pl. This will create a "resources" directory and dump separate files for each resource, with names as in the BRS.

This is still in AFP format. Then apply afp_yamldump.pl to the resource (for example take a formdef or a coded font). You will get something like this. Redirect the output to a file, it will be directly usable for the next script

##############################################
### BCF ###
---
- id: d3a88a
- name: Begin Coded Font
- size: 16
- CFName: X0CR0130
##############################################
### CFC ###
---
- id: d3a78a
- name: Coded Font Control
- size: 10
- CFIRGLen: 25
- Reserved: 01
##############################################
### CFI ###
---
- id: d38c8a
- name: Coded Font Index
- size: 33
- FCSName: C0CR0430
- CPName: T1FTA000
- SVSize: 0
- SHScale: 0
- Reserved: 00000000
- Section: 0
##############################################
### ECF ###
---
- id: d3a98a
- name: End Coded Font
- size: 16
- CFName: X0CR0310

Edit the file as needed. Then convert it back to the afp format with the script:afp_yamlload.pl -i inputfile.yml -o output.afp