1

I've been asked to convert files from PDF to AFP and I've managed it using the IBM afp printer's driver. I was wondering if there's a way to search inside the afp file . I know I can do it on the pdf file but I've been asked to crosscheck the converted files searching inside it.

Is there a reason since a pdf file of 370kb is converted to a 11.5Mb afp file ? is it converted as an image ? (this would clarify why I couldn't search inside it)

PriyankaChauhan
  • 953
  • 11
  • 26
advapi
  • 3,661
  • 4
  • 38
  • 73
  • not directly related but do you know of a good afp viewer ? Thanks – slayernoah May 31 '19 at 17:15
  • BTB Browser https://www.btb.gmbh/en/unternehmen-en/btb-software-en/afp-btb-software-en Compart Docbridge viewer https://www.compart.com/en/docbridge-view – varun teja Jun 04 '19 at 08:41

2 Answers2

3

C is the best option to you to search a string in AFP PTX records. However it depends on how are you converting your PDF to AFP. If you use IBM print dirvers it will rasterize the text. So, you'll be not able to search.

AFP Explorer is one of the best freeware tool if your request is one time. http://www.compulsivecode.com/project_afpexplorer.aspx

We use COMPART CPMCOPY and CPMILL to convert POS and PDF files into AFP. where you will have MFF filters to get the required output. However it is licensed product.

varun teja
  • 126
  • 9
  • thumbs up for the reference to the afpexplorer. not directly related but do you know of a good afp viewer too? Thanks! – slayernoah May 31 '19 at 17:12
0

IBM AFP printer driver can be configured, to some extent. Check this manual page: Creating AFP Resources Using the IBM AFP Printer Drivers for further details.
Make sure that "Print Text as Graphics" is turned off.

Some AFP viewers have the feature of text search within AFP files. Consider BTB Viewer (warning, it looks ridiculously outdated).

If you wish to develop your own solution, consider that in general, searching for text in AFP documents is complicated since each "logical" text block can be split into a series of MO:DCA text instructions, each positioned individually. And it is not for granted that these instructions will be sequential. So expect for problems searching for multi-word strings.

"Conversion" PDF to AFP is a generic term. It depends on what software you used to convert, and what settings were used for conversion. For instance, consider embedded images. Since many AFP devices do not support JPEG compression for I:OCA, the conversion app may convert raster images to raw 24-bit bitmap which is ridiculously ineffective in terms of file size; an innocent background image of 1000×1000 px would take a whopping 3Mb of file size (while the original JPEG stream can be tens kbytes).

Be Brave Be Like Ukraine
  • 7,596
  • 3
  • 42
  • 66