CompulsiveCode.com


AFPviewer

  HyperLink  
     
  This is an AFP viewer I wrote to work with AFP print files.  The program supports viewing/navigating pages, TLEs, applying a grid, copying text, copying image areas, searching for text, printing, and extracting pages to PDF, TIF, XML, JPG, BMP, PNG, GIF.  The program is capable of overlaying an image onto the page (to simulate pre-printed paper).  The program also includes a Resource Manager which lists every resource included in the file and every resource required by the file, and can be used to extract resources.
 

 

History:

01-06-2012:
Added caching of character data, to reduce file access, maybe speed up page loading a little.

01-05-2012:
Fixed a couple bugs in image rendering, relating to the ImageSizeParameter.
Fixed a bug pertaining to Field Segmentation and PTX fields.

11-21-2011:
Fixed a bug when trying to find resources and encountering empty strings.

10-18-2011:
AFPtoPDF now supports images rotated 270 degrees.  Need to test 90 and 180.

10-06-2011:
Dragging an image to the AFPviewer will now open the "Manage Overlays" window, if an AFP file is already open.
The "Manage Overlays" window now supports drag-and-drop for the image file (onto the Image FileName box).

09-16-2011:
Printing now includes any overlays applied through the program.
Fixed a bug in AFP-to-PDF conversion, where DBR/DIR drawn in color WHITE were treated as transparent.

09-15-2011:
Fixed new bug in search.

09-09-2011:
Fixed a bug in AFP-to-PDF conversion, which could order the characters of a font incorrectly in unmapped fonts.
Working on a scaling issue with relative metrics fonts.

08-30-2011:
Fixed an issue that would crash the program if a font used more than 200 FNG fields.

08-18-2011:
Fixed some duplicate JPG resources not being consolidated in AFP-to-PDF conversion.
Fixed Search not working unless 'Display Results in List' was selected.

07-19-2011:
Added some basic support for BOC structures containing image data.
Need to clean up support for Relative Metrics fonts.  Need more samples.

07-18-2011:
Fixed a space-width issue when scaling DPIs.
All of the changes made over the last week or two need to be applied to the AFP2PDF conversion.

07-15-2011:
Rewrote function GetAFPfont, which parses the CodePage and CharSet resources to provide the glyphs in the correct order.
A certain AFP sample test file now displays correctly.

07-11-2011:
Fixed a new bug that was preventing certain page-segments from rendering on a page.

06-24-2011:
TLE Browser and Thumbnail Browser will now save and restore their previous position and size (instead of just the main window).
Thumbnail selection can now be utilized to extract only the selected pages, instead of a page-range.

06-23-2011:
Added Thumbnail Browser. 

06-16-2011:
Fixed processing of image data where the data for a single IMAGEDATA or BANDIMAGEDATA command spanned across two (or more) IPD fields, without a new IMAGEDATA or BANDIMAGEDATA command at the start of the following IPD fields.

06-14-2011:
OneCodeIMB barcode scans correctly.

06-08-2011:
Fixed an issue when converting AFP to PDF, if the MCF structure did not use CodedFonts and also did call for multiple CodePages.  The two arrays (codepages and charsets) were being sorted independently, throwing them out of sync.
Extracting to PDF now supports overlays called through a MediumMap.
The program now properly handles font resources that map a single glyph to multiple code-points.
Fixed an issue with tiled images (BII in particular) being drawn past their specified FillWidth and FillHeight.

06-07-2011:
Added support for modifier to CodaBar functions, for Check-Digit.  Untested.

06-02-2011:
Adjusted some default module-widths in the new BCOCA code (all UPC and EAN were adjusted from 0.008 to 0.013 inches).
Barcodes Code39, UPC2, UPC5, EAN2, EAN5, and MSI all support their Modifiers now.
When a font is missing, the program now handles ascii/ebcdic conversion better, by trying to use the name of the codepage resource and looking for '437' or '500' in the name.
Probably fixed 2-of-5 Industrial and 2-of-5 Matrix.  Still can't scan them with my scan gun, but comparisons with known barcodes are coming out right.

05-31-2011:
UPC-A barcode scans correctly.
UPC-E barcode scans correctly.
Code39 barcode scans correctly.  Need to test extended chars.
Code93 barcode scans correctly.  Need to test extended chars.
Postnet barcode scans correctly.
EAN-8 barcode scans correctly.
EAN-13 barcode scans correctly.
2of5 Interleaved barcode scans correctly.
CodaBar barcode scans correctly.
Code128 barcode scans correctly.  Does mixed-mode encoding.  :)
Unsupported barcode types now appear as an orange rectangle/square, with a black X through the image.

BarCodes that I cannot test due to lack of support in my barcode scan-gun:
EAN2, EAN5, UPC2, UPC5, MSI, 2-of-5 Industrial, 2-of-5 Matrix, RM4SCC, Japan Post.


05-30-2011:
When drawing the text of an outline font, if the font is missing, the text will now utilize the PointSize specified in the MCF field instead of always using 9pt.

05-29-2011:
Added support for GOCA fillet commands.
Need to get partial arcs working.
Need to get line-type (pen style) working.
Need to get pattern-type (hatch style) working.

05-27-2011:
Fixed GOCA fractional line width (SFLW) not reading the fractional portion of the value correctly (was reading the wrong byte).  Any line width less that 1.0 was being treated as zero.

05-25-2011:
The program now displays some BCOCA barcodes. 

05-24-2011:
Fixed a memory-leak in the object-drawing code.

05-23-2011:
When extracting to PDF, solid-colored images saved in the AFP with Replicate-And-Trim specified will now be encoded in the PDF as a single-pixel image stretched to fill the area.
This yields a slight reduction in file size, and better quality printing of the PDF.
Added the ability to extract resources to a single ResourceGroup file.
1-bit images using the color of PaperColor or White are now rendered correctly, thanks to TransparentBlt.  Without the API solution, it was going to be a mess.

05-20-2011:
If an outline font is encountered, and a font with matching name is installed in windows, the program will use the windows font to draw the text.
If an outline font is encountered, and there is no matching font installed in windows, the program will fall back to Courier New 9pt Blue.
Prior to this change, outline fonts were always drawn in the default 'unknown font' of Courier New 9pt Blue.
Eventually, the program will be smart enough to extract the outline font, install it in windows, use it, and remove it.
New version 1.1.3.

05-19-2011:
Added rotation options to page display.

05-18-2011:
Added support for Area Rotation for most objects when rendering to the screen/image.
Added support for Area Rotation for images in AFP-to-PDF conversion.
Need to test Content Rotation some time.

05-04-2011:
The TLE-Browser can now be searched (only the ByValue pane can be searched).
Reduced some image-quality settings, to better accommodate scrolling of large (600+ dpi) pages.

05-03-2011:
Modified TLE-Browser to accomodate browsing by value or by page.

04-29-2011:
Added a basic TLE-Browser.

04-25-2011:
White text now displays correctly.  This change has only been tested with text that is not rotated (ie Zero rotation).
This change also fixes (i think?) some issues with colors blending when they should knock-out the color behind them.

03-31-2011:
The program now applies the page-level MCF font-mapping when rendering a PageSegment.

03-15-2011:
Fixed a bug in the function that byte-aligns raster data for PDF conversion, which was generating an error if the image was only one pixel wide.

03-08-2011:
Added some support for converting 1bit uncompressed image data (with mapping type of SCALEtoFIT) to PDF.

03-07-2011:
Fixed IOB Offset issue (don't know how this got broken -- blaming source-control). 
Fixed conflict between RIDIC specification and some image decoding functions.
No longer positive that RIDIC is being handled correctly.  Need more test files.
Added some support for converting 1bit uncompressed image data (with mapping type of POSandTRIM) to PDF.

03-04-2011:
Modified text-extraction such that two characters will be considered part of the same word if the distance between them is less than one-fifth of the character-height (of the first char).

02-10-2011:
Added support for Xoffset and Yoffset specification in IOB field when IOB object type is an image (PSEG type was already supported).

02-03-2011:
Added support for RIDIC encoding.
Fixed rendering for 8-bit JPEG data.
Fixed support for short MDD fields. 

01-27-2011:
Fixed rendering issue when IDD size did not match IPD_ISP.
Fixed rendering issue when IDD size did not match JPEG image data size.

01-26-2011:
Fixed a couple of GOCA issues.  Some areas were being filled when they shouldn't have been.
Color ColorOfMedium/White probably wasn't working correctly either.  Not 100% on this one yet.

01-11-2011:
Added support for IOB fields that reference AFP objects (PSegs, Images, Barcodes).

11-26-2010:
Fixed ExtractPageToImage function not working with PageSegment files.
Added support for LZW compressed images.  Only tested with 32bit CMYK images.

11-19-2010:
Added support for MIO image mapping in AFP-to-PDF conversion.
Fixed an issue with Get Page Resources In Use not always returning every resource.

11-04-2010:
Added display of cursor X,Y next to the Zoom dropdown.

09-16-2010:
Fixed handling of IPS field with X or Y offset value set to xFFFFFF.

08-26-2010:
Fixed an issue with the arrow-buttons increasing in size when clicked rapidly.

07-16-2010:
Fixed a coloring issue with BII images.  Something was wrong with the 1bit pallette setup (possibly the bitmap info header), so I changed to use a 24bit (non-pallette) image.
Better support for mixing of BitsPerPixel, BitsPerComponent, and Compression.

07-15-2010:
Added support for 32bit uncompressed images.
Added support for RL4 compressed images.
Added support for Point-To-Pel ImageMapping.
Fixed coloring of 1bit compressed image.
Fixed a small BCOCA problem.  The barcodes still don't display, but now the program does not crash.

07-14-2010:
Fixed incorrect placement of BII Image when mixing resolutions.

07-13-2010:
Fixed more GOCA functions.

07-12-2010:
Fixed numerous GOCA functions.

06-25-2010:
Fixed color being ignored on 1bit compressed images.

06-17-2010:
Fixed an issue with new BIM rendering code, where some objects were being rendered at an unncecessarily high resolution.
Added new extraction option:  TIF Group4

06-15-2010:
Fixed small error with File Properties window when opening a file that is not associated with any program.

06-11-2010:
Wrote new BIM rendering function, which takes ImageMapping into account, and can also be adapted to handle rotation.
Content Rotation might be working now.

06-10-2010:
The program now accepts AFP files that do not include the structured field introducer x5A.
Fixed broken viewing of PageSegment files.

06-09-2010:
The program now extracts IBM MMR images to PDF.  Prior to this, IBM MMR images were ignored in AFPtoPDF conversion.
This particular image type is rendered in memory and saved into the PDF as a JPG image.  This is better than no image at all.

05-25-2010:
Fixed applying an overlay to a page which has been auto-scaled due to high DPI.
Fixed extracting to image when a page has been auto-scaled due to high DPI.
PDF extraction now supports IPO fields.

05-14-2010:
Fixed rendering/saving of BII data that is not byte-aligned.

05-07-2010:
Fixed an new issue where extracting to TIF did not preserve the image resolution.
This was most likely broken on 04-27-2010.

04-27-2010:
Modified numerous modules and functions, removing Win32API calls.  Working towards x64 compatibility.
Most CopyMemory calls are gone.  Replaced with BitConverter and the .NET Array class.

04-20-2010:
Fixed an issue with MessageBoxes and InputBoxes being shown behind the main window when KeepOnTop was enabled.

04-01-2010:
Added the option to include the currently-applied overlay when extracting to PDF or to Image.
Fixed an issue in AFPtoPDF conversion, where overlapping color images were not blending correctly.

03-30-2010:
Removed filesize limitations.  Previously, 2.1 gigs was the max file size.  Now it's 9,223,372,036 gigs.

03-25-2010:
Modified the AFPtoPDF conversion function to replace character codes that have a value less than the FirstChar value from the PDF font, with the space char.
Fixed a bug that would require the user to have ServicePack1 of the .Net framework 2.0 to be able to open a file though the 'File-Open' menu command.

03-22-2010:
Fixed a minor issue which would cause the program to use the ShortFileName if the file was opened by double-click in Windows Explorer.

02-17-2010:
Fixed a bug in the recursive object-drawing function.
Changed the program to allow MDD fields with a length of 15 bytes (including field header), eventhough I don't think this is valid.  But the IBM viewer didn't complain about the file.
Rewrote the CommonDialog code with managed .Net objects.
Added support for unicode file names.

01-28-2010:
The program now checks the file date and file time before drawing a page, and re-loads the file if it has changed.

12-07-2009:
Added the ability to resize the page when extracting to AFP.
Changed all code for resizing/positioning controls to managed .Net code using Anchors.

11-20-2009:
Fixed an issue with the resource manager incorrectly marking some items as NOT USED.  This was caused by a sorted array being converted from EBCDIC to ASCII (thereby breaking the sort).

10-08-2009:
Fixed image position that I probably broke last week.
Fixed ASCII/EBCDIC conversion of File Comments in the File Properties window.

10-07-2009:
Extracting AFP to JPEG will now save the JPEG with 100% quality.
Changed decoding of 1bit uncompressed IOCA data to assume rows are padded to 8 bits.

10-06-2009:
Fixed loading of AFP resource files that begin with a field that does not begin an object (ie NOP).

10-02-2009:
Fixed the image scaling that I broke yesterday. 

10-01-2009:
Fixed 1bit uncompressed image data not utilizing the BiLevel Image Color.
Fixed a scaling issue with JPG data, where the size would be wrong if the JPG data specified a DPI different from the object container DPI.

09-29-2009:
Fixed an problem with the way IPD fields were interpreted, if the datalength was in one IPD field, but that actual data was in the next IPD field.

09-15-2009:
Fixed an issue with multiple MCF fields on a single page.
Fixed Page Properties window not clearing.

09-10-2009:
Fixed an image scaling issue.
Adjusted font scaling code to calculate scaled width, and then use the ratio of Width/ScaledWidth to calculate ScaledHeight.

09-09-2009:
Fixed an error with GOCA processing, where all data between the EGR field and the next EIM/EPG field would be ignored.
Fixed an image scaling issue.

09-08-2009:
Some GOCA support has been added.  Polygons and image data should display now.

09-04-2009:
Page size is now controlled by the MediumMap if there is one, instead of always relying on the PGD structure of the page.
The viewer can now display resource files that do not contain a page structure, such as PSegs and Overlays.

09-02-2009:
Added support for viewing non-banded JPEG images with multiple Image Segments.

08-31-2009:
Added support for viewing 8bit gray-scale images.  Haven't tested AFPtoPDF with this yet.
Trying to clean up and re-structure some of the AFP-to-PDF code.

08-27-2009:
Added support for MediumMaps with multiple pages.
Supression code is probably correct now.
Text selection does not currently copy text from objects other than the Page object.

08-26-2009:
Fixed an issue with the ResourceManager, where a resource that was not InLine but was in the resource folders would be listed as InLine.
Fixed an issue processing SetTextColor command, where 'PaperColor' translated to BLACK instead of WHITE.
Fixed an issue with with PGP effecting the position of the MediumMap contents instead of the position of the page contents.
Fixed an error with JPG rendering when the data was not 32bit CMYK. 
The color still isn't correct though.
Added some support for Supression, but it is not yet complete.
Discovered an issue with printing 'PaperColor' text onto black background.  Basically, it doesn't show up, and I don't know if it should.

08-25-2009:
Fixed an issue with rotated text and an issue with SpaceCharIncrement.  Thanks to David Pham for sample files and thorough explanation of the issue.
Added support for scrolling with the MouseWheel.
Keys LEFT and RIGHT are now used for scrolling the current page -- NOT for advancing to next/prev page.  Use PageUp and PageDown instead.

08-24-2009:
Fixed some errors involving the parsing of resource subfolders.  Thanks to Antonio Costa for sample files and thorough explanation of the issue.

08-21-2009:
Updated the code that validates whether a file is valid AFP.
Added a check that confirms the file is valid AFP before trying to open it.

08-20-2009:
Fixed a bug in the MRU list, which would fail to correctly add files with a network path (ie \\spoolserver\spoolfile.afp)
Reduced the required permissions on AFP resource files.  In other words, the program now works with external resources if they are read-only.
Tweaked the positioning of the Zoom dropdown, to compensate for different windows fonts (ie Windows 7).
Changed the infomation boxes in the 'Preferences' window from labels to scrollable text boxes to compensate for different windows fonts (ie Windows 7).
JPEG color definitely needs more work.
Fixed an issue where character-increment was not calculated correctly for high-dpi pages, due to internal image-scaling.
Adjusted the CopyText functionality to determine if two text objects are on the same line, and separate with SPACE instead of CRLF.
Adjusted the CopyImage functionality to compensate for high-dpi pages, due to internal image-scaling.

08-12-2009:
Fixed a printing issue, which would cause pure white to have a slight hint of grey.  The solution was rendering the page at 24bit instead of 16bit before printing.
Added the ability to copy the selected area as an image.
Fixed an issue where the program would not copy the correct area if the page was scrolled and the zoom was anything other than 100%.

08-06-2009:
Fixed an error that would occur if the user copied text while another program had the clipboard locked.

08-05-2009:
Added more options to the Extract Pages interface.  Now, extract to PDF, TIF, XML, AFP, JPG, PNG, BMP, or GIF.
Tweaked file-handling.
Adjusted the CopyText functionality to determine if two text objects are on the same line, and separate with SPACE instead of CRLF.
Fixed an error when copying blank data (nothing) to the clipboard.

08-04-2009:
Fixed missing StatusLabel which floats at the bottom of the app when processing/loading a file.  Solution was BringToFront.
Fixed page display area not updating when maximizing the window.
Overlay images can now be .BMP, .TIF, .JPG, .GIF, .PNG
The overlay is now stored in memory, instead of re-processing it with every new page.

07-31-2009:
Made the BIM JPEG rendering faster by modifying the color palette of each image before blending them. 
The color appears to be slightly off though.  I'm sure this is due to my attempt to blend the CMYK colors in an additive color space.

07-30-2009:
Added support for displaying JPEG images.  But it's too slow.  Need a better method for combining the CMYK images from the BIM data.

07-23-2009:
Tweaked the screen-rendering code to only render what's visible.
Tweaked the image scrolling.
Added a 'Size-Grip' to the bottom-right of the main window.
Separated Icon code from hDC code.
Rewrote scaling for high-DPI images.

07-15-2009:
Got the file size and size-on-disk working correctly in the File Properties window.
Numerous minor bug fixes and tweaks.
Version 1.1.2

07-14-2009:
Before displaying a page, the program now checks that the stored page offset still points to a BPG or IMM field.  If not, the file is re-loaded (instead of crashing).
Text selection now works again.
Re-designed the Resource Manager window.  Now using a ListView, because certain events were removed from the ListBox control in VB.Net.
Modified the CopyText code, to compensate for scrolling the page.

07-09-2009:
Made the FindText window set the focus to the textbox on the form.
Fixed an issue with the Settings window, which would fail to clear the list of categories, and would duplicate items in the list.

07-07-2009:
Fixed an error (introduced in .Net conversion) in modConvert_BMPtoDC which would initialize overlay BMP images with a black background instead of a white background.
Re-implemented Drag-and-Drop.


--
--


04-23-2009:
Rewrote code for printing.  Now using the PageSetupDialog for margins info, and the PrintDialog for other options and finally sending data to the printer.

04-14-2009:
Added support for reversed bit order to the AFP-to-PDF functions.  PDF does not support reversed bit order, so we 'un-reverse' the bits ourselves.

04-10-2009:
Added support for reversed bit order to the image decoding functions.
This was done to support the AFP files output by the Oce AFP 'WAD' Driver.  However, it applies to all generators of AFP.

03-11-2009
Fixed the XObject code.  Functions: PDFwrite_AddRes_BeginFormXObject, PDFwrite_AddRes_EndFormXObject, PDFwrite_OverlayPageWithXObject.
These functions can be used to modify existing pages.
I abandoned these functions a year ago.  I got them working today.

02-09-2009:
Fixed a potential problem with the Search functionality, where a temp file could be left open.
Converted source code from Visual Basic 6.0 to VB.Net 2005.

01-14-2009:
Fixed an issue with the Image Consolidation code in the AFPtoPDF conversion, where the program would identify a duplicate image, but still store the duplicate(s) in memory.

12-29-2008:
Code changes.  Removed all UDTs. 

12-02-2008:
Added image-consolidation for JPEG images when converting AFP-to-PDF.
Added image-consolidation for G42D images when converting AFP-to-PDF.
I spent 3 years (see 04-23-2005) not thinking about it.  But now I finally got the image consolidation working well.
Removed old unused functions.  Renamed some functions for clarity.

12-01-2008:
Fixed an error that prevented TTF files from being used in AFP-to-PDF conversion.

11-29-2008:
Fixed an error in the AFP-to-PDF function that builds Type3 raster fonts on the fly, which was leaving off the width of the last character.
Fixed the same error for TTF fonts.

11-24-2008:
Fixed an error in the Resource Manager that would cause PageSegments and MediumMaps to be listed as NOT USED even if they were used in the file.
AFP-to-PDF conversion will now process inline PageSegments.  Only converts the images in the PageSegments.. Does not convert the text in the PageSegment.. yet.

10-17-2008:
File Properties window no longer crashes when trying to determine file size of remote (network) file.
File Properties window now renders the Associated Icon correctly.
File Properties window now displays the file size the same way as Windows Explorer File Properties.

10-09-2008:
Fixed AFPtoPDF conversion error when AFP font is a relative-metrics font and PDF font is a TTF/PDF.
Working on fixing a conversion error when AFP font is a relaitve-metrics font and PDF font is a Type3 font generated on the fly.

10-06-2008:
Fixed an error in the AFPtoPDF conversion which would ignore fonts that were specified without a CodedFont.
Fixed an error in the AFPtoPDF conversion which would generate an error if the pages being converted all contained no CodedFont resources.
Fixed an issue where the default ZOOM value could be saved as a value too large, and would prevent the program from opening ever again.

08-04-2008:
Changed the program to search for "?0" versions of CodedFonts, CodePages, and CharSets, if the specifically named resource cannot be found.
Previously, this was only done for coded fonts.

05-23-2008:
Fixed an error that prevented external Overlays and PageSegments from functioning correctly.  This problem was most likely introduced on 09-19-2006.
Fixed an error that would crash the program if a BIM/EIM structure contained no IPD data.
Fixed an error in the AFPvwr_FindExternalResource function, which would not find a resource if the following conditions were met:
 1. The resource is not in-line.
 2. The resource is referenced with a name like 'X1' but the actual resource name is 'X0'.
Thanks to David Vose for the sample files to assist in resolving these issues!

03-19-2008:
Added new function to modPDF:  PDFwrite_OverlayPageWithXObject.  This can be used to add content to an existing page.

03-15-2008:
Added new function to modPDF:  PDFwrite_AddRes_BeginFormXObject.
This can be used to create a Form object, which is essentially an object that can be applied to other pages.

03-07-2008:
Added new function to modPDF:  PDFwrite_MovePage.  This is for changing the order of the pages before closing the file.
Using nothing but code, it is now possible to:
-Open an existing (or new) PDF file
-Add font and image resources
-create pages containing text, images, line-art
-move pages
-delete pages
-close the file

03-06-2008:
Added new function to modPDF:  PDFwrite_CreateFileFromExistingPDF.
This basically copies all of the existing PDF, except for the closing structures, and allows the file to be appended with other modPDFwrite functions.
Though not really related to the AFPviewer, this is still extremely cool.


--
--


09-07-2007:
Fixed an error that would leave an AFP file locked if the file referenced inline page-segments, medium-maps, or page-overlays.
This error prevented the "Delete File" and "Move File" functions from working.
This error was most likely introduced on 09-19-2006.

09-04-2007:
Added a button for testing FTP connection settings (on the Settings window).

08-24-2007:
Removed the SlideShow Options window.  Replaced with a frame on the Preferences window.  The result is a smaller EXE.
Working on Relative-Metrics Fonts in AFP-to-PDF conversion.

08-17-2007:
Adapted some functions in the AFP-to-PDF conversion to accomodate fonts that use a CodePage and CharSet without a CodedFont.
Basically, bolted some ugly code onto a few procedures.

08-15-2007:
Came up with a way to directly embed TTF files in a PDF.  The AFP-to-PDF conversion will now work with TTF fonts as well as "PDF fonts".  This I think is very cool.
Re-designed the Preferences window, with a more user-friendly interface, more options, and more expandability.

08-10-2007:
Fixed a bug in AFP-to-PDF conversion when fonts are external resource files.
Fixed a bug in the FNG/CrLf removal code.
Fixed a bug in AFP-to-PDF conversion where character A-space was being ignored.

08-08-2007:
Implemented Type3 fonts in AFP-to-PDF conversion as a fall-back when PDF fonts are not mapped.  Not 100% perfect, but pretty close!
NOTE:  This does NOT presently convert EBCDIC text to ASCII for copying text from the PDF.
NOTE:  For the best quality on-screen rendering, Acrobat version 6 or higher is recommended.
NOTE:  There could potentially be bugs that I am not yet aware of.
Version 1.1.1

07-22-2007:
Experimenting with Type3 fonts in PDFs. 
Pro:  Does not require mapping AFP fonts to "PDF fonts".  It just works.
Con:  Larger and more complex PDF files.
Pro:  Can be a fall-back if font-mapping is not available.
Con:  Looks bad on the screen with Acrobat 5 or earlier -- STILL PRINTS GOOD QUALITY.
Con:  Adds more complicated code to the AFP-to-PDF conversion routines.

07-18-2007:
Fixed the SlideShow functionality.

07-06-2007:
Fixed the "Fit-In-Window" functionality under the "View" menu.

06-15-2007:
Changed the way the Viewer program applies an image-overlay to the page.  Image-overlays are now persistent, and can be toggled on/off.

05-01-2007:
Fixed an error where multiple PageUp or PageDown commands would cause a file-error.

03-05-2007:
Fixed an error that prevented the "Apply Overlay" functionality from working.

02-15-2007:
Fixed an error in modConvert_AFPtoPDF where text would be drawn in the wrong location if no position command was present between orientation command (STO) and text command (TRN).

02-06-2007:
Removed the Extract Resources interface.  Replaced with the new Resource Manager interface.
Version 1.1.0

02-05-2007:
Added an interface for displaying Resource-Usage. 
This used to be a separate program.  But, having now come up with a pseudo-ListView, it has been added to the AFPviewer.

01-16-2007:
When an unsupported MODCA color is encountered, it is now printed in greyish-green, instead of black.
This will probably be changed at some point.

12-19-2006:
Changed the way that font charset resources are processed during AFPtoPDF conversion.  Faster, but kind of obscure.

10-11-2006:
Fixed a small bug that was added to the program on 10-04-2006, which could cause the last font in an MCF field to not be treated as a required font.

10-10-2006:
Fixed a bug in the Viewer program that caused the Extract-Pages window to treat the page-dimensions specification as integer values instead of decimal values.
Modified the Find window in the Viewer program to display the number of results when the 'Display Results In A List' option is selected.

10-06-2006:
Modified the File-Open dialog in the Viewer program to list 'AFP Files' or 'All Files'.

10-04-2006:
Rewrote the resource verification functions.  Now faster and cleaner.
Modified the PageProperties window of the Viewer program, to indicate which resources are In-Line.
Modified the PDF_FormatNumber function in modPDF to make sure the decimal point is always a period (not a comma) due to international differences.

10-03-2006:
Fixed an error where an image offset was not being scaled correctly, causing an image to be draw in the wrong location.
The IOCA image-rendering functions could use a clean-up.
Modified the Viewer program to prevent PageUp/PageDown and ArrowUp/ArrowDown keys from accidentally scrolling within the Zoom and FileList dropdown boxes.
Basically, after drawing a page, the program sets the focus to the frame that displays the page.

10-02-2006:
Modified Viewer program to locate X0 fonts when an X1 font is specified and cannot be located.
Fixed an error in modConvert_AFP2DC where FNG fields were not being read correctly when CrLf was present between fields.
The program is roughly 30,000 lines of code, not counting blank lines or comments.

09-27-2006:
Contemplating an AFPtoPDF conversion that builds Type3 fonts into the PDF, instead of TrueType fonts.
This would eliminate the need for font-mapping, but could result in larger PDF files, and decreased text fidelity.

09-25-2006:
Rewrote all text-rendering code to handle relative-metrics, and mixed DPI (ie an overlay at 1440dpi on a 300dpi page).
Version 1.0.9

09-19-2006:
Implemented some private 'state' variables, kind of like a Graphics-State in a PDF.
- FileState maintains the afpFileName, afpFileSize, afpFileNumber.
- PageState maintains PageWidth, PageHeight, PageDPIx, PageDPIy, PageXOffset, PageYoffset, MCFarray.
- TextState maintains Xpos, Ypos, ILrotation, BLrotation, ILmargin, BLincrement, FontNumber, Color, VarSpaceInc, Interchar-Adjustment, UnderLine, OverStrike.
This means there are far fewer variables being passed from function to function.  Cleaner code.
Also, this makes the code more like a Class than a Module.

09-13-2006:
Modified the resource-verification functions, to handle pages that do not have a MCF or MCF1 field.

09-05-2006:
Modified function BII_2_DC in modConvert_AFP2DC, to accomodate IID structures that do not specify the correct size.
Basically, I added a function to parse the entire BII-EII structure, and determine the maximum extent of the image.

09-04-2006
Modified the resource verification functions, so that only fonts that are actually used in a PTX field will be considered 'required'.
The old method treated any font in an MCF/MCF1 field as a required font, even if the font wasn't used on the page.

09-01-2006:
Finally added support for fonts using Relative Metrics to modConvert_AFP2DC. 
It doesn't quite work right for rotated text yet though.
So, not done yet.

08-31-2006:
High-resolution (600dpi) pages take way too long to draw/scroll on the screen.  Need to remedy this.

08-30-2006:
Changed the way images are copied in memory.  Instead of copying the entire image, it is now broken down into tiles and copied.
This gets around some memory limitations.
Maximum tile size is set at 1000x1000 pixels for now.
No noticable change in speed.

08-29-2006:
Fixed an error in the AFP_GetOBPinfo function of modAFP, where offsets were not being treated as signed values.

08-13-2006:
Changed Viewer program to look for resources in the specified path, as well as first-level subdirectories of that path.

07-24-2006:
Re-vamped the text searching capabilities.  Now much faster, and results can be displayed in a list.

07-07-2006:
Changed numerous functions in modConvert_AFP2PDF.  Most frequently used variables are now stored as Private variables.
Variables Changed: 
PGDwidth, PGDheight, PGDdpiX, PGDdpiY, AFP2PDF_PDFpageWidth, AFP2PDF_PDFpageHeight
AFPfileNumber, PDFfileNumber, AFPfileLength, AFPfileName, PDFfileName
PageImages(), PageImageCount, FileImages(), FileImageCount, AFP2PDF_NumPagesConverted
This means there are far fewer variables being passed from function to function.  Cleaner code.
Also, this makes the code more like a Class than a Module.

07-03-2006:
Completely rewrote the parts of modConvert_AFP2PDF that handle images.
An AFP page is now processed twice when converting to PDF.  Once for the images, and again for the text, lines, and psegs.
Arrays are maintained for resource consolidation, resulting in a 75% decrease in file size for some files.
Added support for 32bit JPEG CMYK images to modConvert_AFP2PDF (output PDFs require Acrobat 5 or higher).

06-15-2006:
Added the ability to print more than one page at a time.  It's not super-fast, but it gets the job done.

06-12-2006:
Added the ability to go to a page by specifying an offset.

04-18-2006:
Added support for the 'Set Bilevel Image Color' self-defining field to modules modConvert_AFP2PDF and modConvert_AFP2DC.

04-12-2006:
Removed the change made on 10-05-2005 to the PDF_FormatNumber function.

04-10-2006:
Added support for uniform values in FNO field.

02-14-2006:
Fixing the relative-metrics issue in modConvert_AFP2DC.  Need to update other modules.

02-08-2006:
Things to do (for AFP-to-PDF):
  Fix relative-metrics issue with fonts!
  Add support for 32bit images!
  Add support for tiled images!
  Add support for Flate encoding - For smaller PDFs.
  Add support for Flate decoding - For unicode PDF fonts, and general PDF parsing.

02-06-2006:
Updated and cleaned up some IOCA code-points.

02-02-2006:
Investigating a character-positioning problem.  May be related to Relative Metrics.

01-18-2006:
Fixed an error in module modConvert_AFPtoDC, where character vertical position was not correct (used Ascent instead of Baseline Offset).

01-17-2006:
Fixed an error where variable space increment did not reset correctly, resulting in a space-width of 65535 pixels.

12-15-2005:
Fixed an error in function AFPwrite_AddResource, where the same resource could be added to a file multiple times (epecially codepages and charsets).

12-14-2005:
Fixed an error in function AFP_BuildMCFstring, where the length of the ResourceLocalID (fontnumber) triplet was incorrect.
Modified the way the output file is managed in modAFPwrite.  AFPwrite_CreateFile now returns an open file handle.  AFPwrite_CloseFile closes it.

12-10-2005:
Wrote numerous AFPwrite_ functions, including a very nice (yet simple) word-wrapping DrawText function.

12-02-2005:
Modified modAFP2PDF to place patterns on the page AFTER any overlays. 
Patterns are 1bit and allow transparency, so this should be a safe change.

11-02-2005:
Changed default grid in Viewer program to 4 lines per inch instead of 3 lines per inch.
Slightly modified File Properties window in Viewer program.

10-07-2005:
Cleaned up the low-level functions for building AFP fields in modAFP.  Added support for more fields.
Added function AFPwrite_AddPageObject_BMPfile.  The function treats each row of the BMP as a cell with a height of 1 pixel.  Supports 1-bit images.

10-06-2005:
Added some functions to modAFP to support writing BCOCA objects (barcodes).  These will probably never be used.
Added BCOCA constants for BarcodeType.
Modified definitions for converting AFP color codes to color-names and RGB (thanks to the most recent MODCA spec).

10-05-2005:
Modified function PDF_FormatNumber to no longer use the Format$ function. 
Instead, it separates the integer and decimal parts of a number (using integers) and appends the integer and first 3 decimal digits.
Some Performace increase.  File Size increase of up to 5%.

09-20-2005:
Modified function AFPfile_GetInitialComments to read up to 10 fields of non-NOP data before giving up on comments.
Modified Viewer program to convert null characters (char 0) to spaces when viewing file comments.
Fixed an error in function IPDS_GetWICinfo, which was not retreiving the correct Y-position value.

08-25-2005:
Modified Viewer program to accomodate non-integer point sizes for PDF fonts (for AFPtoPDF conversion).


--
--


06-30-2005:
Added function PDF_BuildLinearizationDictionaryString to modPDF.  Eventually, this may be used for writing Linearized PDFs (not for a while).

06-10-2005:
Modified functions PDFread_GetFileFontArray and PDFread_LoadFileResources to utilize open file numbers instead of re-opening a file.
Modified modAFP2PDF PDFfont resource processing, to cache PDFfont info to avoid parsing PDFfont files for every conversion.

05-20-2005:
Fixed an error in AFPtoXML conversion when compensating for special XML characters in string data.

05-16-2005:
Fixed an error in AFPtoXML conversion when processing MCF commands, which corrupted the internal array of cached AFP fonts.

05-11-2005:
Fixed text processing in AFPtoXML conversion to compensate for markup characters (greater-than, less-than, and ampersand).
Finally added full font support to AFPtoXML conversion (similar to AFPtoPDF).
The above change allows text width to be calculated, and allows ascii/ebcdic codepage detection.
Added 'copy selected text' functionality to Viewer program.  Not super-precise, but it works.

04-29-2005:
90% of UDTs passed to API functions have been replaced with byte-arrays.  Only modDC and modPrinters need to be addressed.

04-24-2005:
Removed the /Name entry of objects added to a PDF (images, fonts, etc).
Removed the /ColorSpace entry from images that are defined as ImageMasks.
The above changes help reduce file size, and they are recommended by the PDF spec.

04-23-2005:
Reverted to a backup of the code for modPDF and modConvert_AFP2PDF from 04-11-2005.
Re-implemented the change from 04-21-2005 to add 1-bit TIF files to a PDF as ImageMasks.
Re-implemented the change from 04-19-2005 to reference fonts by shorter names ('F0', 'F1', 'F2', etc).
Re-implemented the change from 04-13-2005 to functions 'PDFwrite_GetResourceIDMapFromID' and 'PDFwrite_GetResourceIDMapFromOriginalName'.
Basically, un-did everything involving image/pattern consolidation.

04-21-2005:
Modified modPDF to treat 1-bit TIFs as ImageMasks when added to a PDF.  This allows the white areas to be transparent.

04-19-2005:
Modified modPDF to consolidate duplicate Pattern objects (under 4k in size) on the same page.
Considering similar consolidation for small duplicate page-level images (big ones take too long to compare) into modConvert_AFP2PDF.
Modified modConvert_AFP2PDF to reference fonts by names 'F0', 'F1', 'F2', etc, instead of encoding the entire AFP font name ('X0ARxxx').

04-13-2005:
Removed all old functions based on strings from modAFP.  Newer functions still have the '_Bytes' suffix, which will eventually be removed.
Still trying to get more speed out of AFP-to-PDF conversion.
Modified some very important functions (PDFwrite_GetResourceIDMapFrom...).

03-29-2005:
To Do:Finish modConvert_AFP2XML, and use it to remodel modConvert_AFP2DC.  Then, attempt modConvert_AFP2DIB, and modConvert_DIB2TIF. 
The above changes are estimated to cut AFPtoTIF conversion time by 50%.

03-23-2005:
Modified modConvert_AFP2PDF to embed images using their full path filename (with slashes being replaced by asterisks) and file size as the ImageID.
The above change allows images with the same name from different folders to be embedded.
The above change also allows images with the same name from the same folder with different sizes to be embedded.

03-22-2005:
Modified modConvert_AFP2PDF to accept pattern-filled IOCA uncompressed images. 
The above change is required because new versions of Pres utilize pattern-filled IOCA uncompressed images instead of IM-Images.
The above change needs to be expanded to work with pattern-filled IOCA compressed images.  And all of this needs to be applied to modConvert_AFP2DC.

03-18-2005:
Fixed an error in modConvert_AFP2PDF that did not allow overlays to be used, due to a resource naming issue.

03-01-2005:
Added functionality allowing extraction of AFP pages (with required resources). 
This still does not embed external resources though.

02-16-2005:
Contemplating new 'Cancel' functions.  AFPread_GetPageOffsetArray_CANCEL, Convert_AFPtoPDF_CANCEL.
In modConvert_AFP2PDF, added FileExists check before opening the AFP file, and any PDF fonts.  Need to do the same for images.

02-14-2005:
Added 'Delete File' option under 'File' menu in Viewer program.
Changed MRU list in Viewer program to hold 9 items instead of 8.
Removed some unnecessary stuff from modPDF.  Nothing special.
Fixed an error in modConvert_AFP2PDF, which would cause page-segments to be ignored if the file contained no fonts.

02-11-2005:
Modified Viewer program to allow conversion to PDF even if some fonts are not mapped.
The above change will make testing and debugging of missing-font issues much easier.

02-10-2005:
Modified the way AFPfonts and PDFfonts are loaded, managed, and used in modConvert_AFP2PDF.
Result:  Conversion time dropped by 38% or more.
All unnecessary performance bottle-necks have been removed.
5,142 page file that used to take 6 minutes to convert now takes 110 seconds.
85% of conversion time is spent on string-construction for Text and Rects in the PDF.
Fixed an error in modConvert_AFP2PDF which caused pageCropWidths to be ignored.

02-09-2005:
Reduced the size of AFPfont structure in modConvert_AFP2PDF considerably.

02-08-2005:
Added Resource-Count tracking to modPDF, and removed UBound and ReDim statements for PDFwrite Resources.
Changed numerous optional variables in private functions to no longer be optional.

02-07-2005:
Reduced PDF file size by setting text position with 'Td' command instead of 'cm' command for non-rotated text.
The above change works because each text object is enclosed in BT...ET commands.
Result:  7,600 page file went from 95 megs to 90 megs.  No Noticable quality loss.

02-04-2005:
Reduced PDF file size by not specifying color for an operation if color is black, and setting color back to black after a non-black operation.
The above change applies to Text, Rects, Patterns, and Lines.
Result:  7,600 page file went from 111 megs to 95 megs.

02-02-2005:
Added some constants to modPDF, which speed up the FindNextStopPos function.
Made numerous small changes to get more speed.

01-31-2005:
Enabled text searching in Viewer program, via AFPtoXML conversion.  It's not perfect yet, but it is useful to have.
Things that need to be completed:  text highlight, results list, unicode.

01-26-2005:
Finished clean-up of modConvert_AFP2PDF.
Fixed an error in Pattern code in modPDF, which specified incorrect pattern raster width.

01-25-2005:
Rewrote BPT_2_PDF function in modConvert_AFP2PDF, breaking it down into 5 parts (BPT, PTX, PTX_DIR, PTX_DBR, PTX_TRN), much like modConvert_AFP2XML.
Fixed an error in Pattern code in modPDF, which caused PDFs using patterns to be unviewable in Acrobat 5.
Modified function PDFwrite_AddPageObject_Rect to accept Xpos, Ypos, Width, Height instead of X1, Y1, X2, Y2.
Removed all global variables from modConvert_AFP2PDF.  They were unnecessary, as the module has only one public function.

01-24-2005:
Modified the way patterns are printed.  Now, the pattern increment is 0.1 points greater than the pattern size.
The above change resolves the issue with patterns zoomed below 100%, with only a very small loss of print quality.
Functions that create an empty data-type in modConvert... modules now accept the variable by-reference, instead of dimensioning a new one to return.
Removed more functions from modConvert_AFP2PDF.  Attempting to re-structure a bit.

01-20-2005:
IM-Images that utilize fill-width or fill-height are now written to a PDF as a Pattern resource.
IM-Images that do not utilize fill-width or fill-height are written to a PDF as a page-level (inline) image.

01-19-2005:
Changed the way IM-Images in AFP files are converted to PDF.  Now taking advantage of patterns in PDFs.
The above change results in much smaller PDFs, but pattern quality degrades when zoomed below 100%.
Resource-Tracking for Pattern resources in modPDF is slightly confusing, but it works.

01-17-2005:
Minor optimizations.
Reduced PDF file size by eliminating unnecessary data (specifically the Td command).  Size went down by 3 MegaBytes on 5,142 page file.
The file mentioned above takes 16 seconds to verify resources, and 6 minutes 2 seconds to convert to PDF.
Created new function PDF_FormatText, which is hopefully faster than seven calls to the Replace function.
Renamed more functions in modConvert... modules.
Removed a few more unnecessary functions.

01-13-2005:
Viewer program now verifies AFP resources before page extraction (to download any missing resources from FTP).
Tested 'Advanced Compiler Options'.  Disabled all error checking.  Though everything worked, no noticable speed gain.

01-12-2005:
Removed XY-Tracking in Viewer program.
Added 'Extract Resources' dialog to Viewer program.

01-10-2005:
Modified AFP2PDF functions to use new core functions based on byte-arrays.
Old core functions based on strings will remain for a while, just in case of an emergency.
Version 1.0.8

01-09-2005:
Modified function PDFwrite_AddPageObject_Text to allow 'Word-Space' to be specified.
Modified modConvert_AFP2PDF to utilize Word-Space setting in PDF output to create more accurate PDFs.  Accuracy is now near 100%.
Due to the above change, PDF file output size went up by less than 1 kilobyte per page (on average).
Removed useless elements of the internal datatype 'AFPfont' in modConvert_AFP2... modules.

01-07-2004:
Modified AFP2DC functions to use new core functions based on byte-arrays.
Once the AFP2PDF functions are modified to use the new core functions (and tested), the old core functions based on strings can be removed.

01-06-2005:
Found and fixed a very old error in the AFPread_GetCodepageInfo function.
The function would continue reading past the end of the codepage and read any following codepages until reaching a BeginPage command.
The result of the error was an incorrect space character or default character.

01-04-2005:
Created 'Page Properties' dialog in Viewer program.
Cleaned up 'File Properties' dialog in Viewer program.  Similar to the 'File Properties' dialog in Explorer.

12-28-2004:
Modified AFP2XML functions to use new core functions based on byte-arrays.

12-26-2004:
Wrote new versions for ALL of the core AFP functions for reading fields. 
New functions accept byte-arrays instead of strings.  New functions are suffixed with '_Bytes' for now.
The Byte-arrays are passed by-reference, instead of by-value.  This should be faster.
Byte-arrays require less memory, and can be used with CopyMemory.

12-20-2004:
Fixed byte order for StripByteCount in TIFwrite functions.
AFP2XML is 70% done.

12-15-2004:
Renamed numerous conversion functions in modConvert... modules.  Not done yet though.

12-13-2004:
Renamed 'modImageFiles' to 'modDC'.
Started modXML and modConvert_AFP2XML.

12-07-2004:
Modified more AFPread functions in modAFP and modConvert_AFP... to pass file numbers, avoid re-opening files.  Noticable speed boost.

12-06-2004:
Added 'Me.Icon = frmMain.Icon' to the 'Load' event of all forms in Viewer program.  This ensures all task-icons (ALT+TAB) look right.

12-03-2004:
Moving code from modImageFiles to invdividual conversion modules (modConvert_BMP2DC, modConvert_TIF2DC, modConvert_DC2TIF, etc).
The above changes still require some function renaming.
Moved CCITT code from modImageFiles to modTIF.

11-30-2004:
Re-designed 'SlideShow' dialog and functionality in Viewer program.

11-29-2004:
Modified modAFP to use sorted arrays for AFPresources.  This applies to AFPread_ functions and AFPwrite_ functions.
Re-designed 'Extract Pages' dialog and functionality in Viewer program to accomodate multi-page or single-page extraction to different formats.
Removed menu 'File_SaveAs...' from Viewer program, as it was unnecessary after the above change.

11-28-2004:
Started modTTF for working with TrueTypeFont files.  This will be beneficial in numerous ways.

11-23-2004:
Renamed some functions.  AFPread_Find... functions being replaced with AFPread_Get... functions.
Modified parameters for BPG_2_PDF function to accept psegImagePath variable. 
This is more straight-forward than using either the AFPresourcePath or PDFresourcePath for PSeg Images.

11-22-2004:
Modified the sorted array functions to accept a parameter for itemCount, to avoid some array redimensioning.

11-10-2004:
Wrote numerous string-array functions for use with sorted arrays.  Function names are prefixed 'ArraySsorted_'.
Cleaned up AFPread_GetPageRequirements function(s) to utilize sorted arrays.
The above change resulted in performance gains and much less memory usage when reading multiple pages.

11-09-2004:
Cleaned up BPT_2_PDF code in modConvert_AFP2PDF.  Now utilizing byte-arrays.

11-08-2004:
Modified the way character widths are managed.  Now using a small resource array initialized in BPG_2_PDF function.
This reduced the performance hit incurred from the TextWidth checking (09-23-2004) by 90% or more.
Added more open file number support to PDFread functions.
Modified ASCII/EBCDIC conversion functions in modAFP to avoid performance hit from string concatenation.
Dramatically reduced PDFwrite output file size by adjusting (and utilizing) precision on decimal values.
Results of change described above:  50 page PDF file was 1,275 KB.  Now 908 KB.  No noticable quality loss.  And less disk-writing = more speed.
 
11-01-2004:
Finally renamed modAFPDS to simply modAFP.

10-15-2004:
Modified parameters for function BPG_2_PDF.  All resource arrays (except Overlays) use the specified Resource Path.

10-11-2004:
Fixed an error in AFP_GetMPSinfo and AFP_GetMMOinfo, causing the last mapped object to be omitted from the array.
Began writing output management code for AFPwrite_ functions.  Similar to PDFwrite_ functions, but not as complicated.

10-08-2004:
Added more functionality to AFPwrite_ functions.  Attempting to offer all the abilities of PReS.

10-04-2004:
Modified AFPwrite_ functions to accept an open file number, and condensed AFPwrite_ file I/O functions.

09-30-2004:
Moved datatypes 'AFPfont' and 'AFPchar' (and associated functions) out of modAFPDS, and into 'modConvert_AFP2...' modules.
Made the above datatypes private, as well as the functions working with those datatypes.

09-27-2004:
Removed BPG_2_CSV functions.  These will be superceded by BPG_2_XML or AFP_2_XML.
Removed Text-Selection functionality from Viewer program, until XML output is functional.
Finally created separate modules for BMP and TIF files (modBMP.bas and modTIF.bas).  Cleaned up BMP code.

09-23-2004:
Added TextWidth checking to BPT_2_PDF function.  A serious performance hit is incurred, but output is much more accurate. 
The above change will be re-written to avoid the performance penalty.

09-17-2004:
Structured ALL error-trapping.  No more 'Local Error' traps.  All traps (where applicable) are now terminated with On Error Goto 0.

09-12-2004:
Added 'ChooseFont' and 'ChooseColor' functionality to modCmDlgDLL.
Removed some unnecessary functions from modStrings and modFiles.

09-07-2004:
Modified all private functions that convert 4 bytes to a LONG.
Found and fixed an error in TIFwrite_AddHeader, causing bad TIFs to be created.

09-06-2004:
Removed numerous private UDTs and replaced with byte-arrays for passing to APIs.
This change enables a better conversion to .NET, taking care of Marshalling before conversion.

09-01-2004:
Removed all old FTP code from modFTP (finally).  Now all FTP code is 'hFTP' style.

08-31-2004:
Migrated modFiles to utilize API, better error-trapping, for .NET compatibility.

08-24-2004:
Wrote (and implemented) numerous functions for working with arrays.  ArrayS_ for strings, ArrayB_ for bytes, ArrayL_ for longs.

08-22-2004:
Renamed numerous constants and functions in modAFPDS, to better define the separate parts of MODCA.
Preparing to migrate AFP code to use byte-arrays instead of strings for field data.  This will reduce memory usage, and may add some speed.

08-17-2004:
Modified hDC_2_PicBox and hDIB_2_PicBox to support SystemColors for PicBox BackColor.
Added support for IBM MMR Compression to BIM_2_DC function.
EXE Size = 668K.  Wow.

08-16-2004:
Replaced PopupMenu (right-click menu) code with API (modPopUpMenu.bas).  Now .NET compatible.

08-10-2004:
Added BIM_2_PDFpagestream code to import Group4 images from AFP to PDF.
Added support for Group4 Compression to BIM_2_DC function.

07-29-2004:
Modified some hDIB functions.  No more specific support for Top-Down DIBs.  Instead, dibHeight can be positive or negative.
Modified hDIB_DrawRect and hDIB_InvertRect to accept X,Y,Width,Height instead of X1,Y1,X2,Y2.
Rewrote Rotation_RotatePoint function, and added Rotation_GetRotatedRectRange function.
Added function hDIB_DrawText, which utilizes a temporary DC to draw text, and temporary DIBs to apply it to the destination DIB.

07-28-2004:
Added function hDIB_TransferSection to copy data from one DIB to another (assuming BitsPerPixel is the same).

07-27-2004:
Added many DIB functions.  DrawLine_Horizontal, DrawLine_Vertical, DrawGradient, Dot, DrawRect, InvertRect, GetPixelColor.

07-23-2004:
Fixed Color_RGB15_2_RGB function.

07-22-2004:
Progress made with DIB code and memory manipulation.  hDIB_2_TIF removed until hDIB's are a feasible replacement for hDC's.
Wrote an awesome set of memory manipulation routines, based on my 'binary pattern transfer' supporting logical operations (ie Raster Ops).
The new set of functions will enable code migration for using hDIB's instead of hDC's.

07-21-2004:
The FTP transfers would be faster if a single connection was maintained to download all necessary resources.
Cleaned up some registry code.  Reduced compiled app size.
Removed InitImageConstants function.  Replaced with TIF_InitConstants for TIFs, and dynamic arrays of 2^n for exponents.

07-15-2004:
Rewrote TIFread and TIFwrite functions.  Much cleaner, easier to debug.  More reliable.  Preparing to move to module modTIF soon.
Renamed the color-conversion functions in modImageFiles. 

07-06-2004:
Fixed an error (that I recently created) which did not adjust the X2,Y2 values correctly if X1,Y1=X2,Y2 when drawing a Rect to a DC.

06-30-2004:
Added even more open file number support to modPDF.  The code is also a *little* cleaner now.  And Faster.

06-29-2004:
Modifed PDFwrite module to accept more open file numbers, and always format floating point values.  Result = FASTER.

06-10-2004:
Fixed an error in PDFwrite_AddRes_TIF and PDFwrite_AddRes_FontFromPDFfile, that prevented multiple resources from being imported from one file.

06-09-2004:
Added even more FieldInfo functions to modAFPDS, and support for more triplets.
Adjusted precision of hDC_CopySection function.

06-08-2004:
Added more FieldInfo functions to modAFPDS, and support for more triplets in fields.

05-27-2004:
Moved Jpeg code to new module - modJPG.  May do the same for TIF and BMP.

05-25-2004:
Fixed an error in JPGread_GetImageInfo function, where resolution stored in Centimeters was not converted to DPI correctly (Thanx Vadim!).

05-21-2004:
Modified PDFwrite functions to pass open file numbers, to seriously enhance processing speed.

05-19-2004:
Added function PDFwrite_AddRes_Tiff_Group3or4 to modPDF.
Renamed PDFwrite_AddRes_JpegFile to PDFwrite_AddRes_Jpeg.
Fixed an error in BPG_2_DC function, causing X and Y offsets to be handled incorrectly.

05-18-2004:
Added smart caching of AFPfont info (not raster data) to AFP module.

05-11-2004:
Optimized some of the bit manipulation routines with static arrays of numbers (2's powers).
Modified the CreateFileAssociation functions so they no longer work with a non-local executable.

05-08-2004:
Cleaned up BPG_2_DC function -- removed TextHighlight support for now. 

05-07-2004:
Removed 'OLE Automation' reference from Viewer program.  (required changing Checked/Unchecked to vbChecked/vbUnchecked).
Printer code re-write complete.  Now API based.  Now located in new modPrinters module, as opposed to modImageFiles.  Now VB.NET compatible.

04-18-2004:
Added 'Extract Pages' functionality, to convert multiple pages to TIFs, allowing page re-sizing.

04-14-2004:
Added support for 16bit non-palette DIBs and DCs.  Memory savings of 33%.  Working on Palette image support.

04-13-2004:
Fixed an error in the Registry_GetValueName and Registry_GetValueType functions, causing a serious memory leak.

04-12-2004:
hDC_2_TIF test file takes 18 seconds.  hDIB_2_TIF takes only 8 seconds, thanks to CopyMemory function, byte arrays, etc.
Modified PDFread_GetResourceItemValue function to support value arrays.  Might need the same for PDFread_GetResourceValue function.

04-11-2004:
Modified PDFread_GetFileFontArray function to ignore CID fonts.
Modified PDFwrite_AddRes_Type1Font to discern Type1 fonts from TrueType fonts.

04-08-2004:
The PDFread_GetFileFontArray function no longer includes fonts of Subtype CIDFontType0 or CIDFontType2 in the returned array.
The change listed above increases speed in some instances, and fixes a serious issue.
The PDFread_GetFontInfo function is now broken into 3 separate functions.
Fixed an error in the BPG_2_CSV function, causing page dimensions to not be output when a MediumMap was encountered.

04-07-2004:
Modified PDFwrite_ functions to accept variables of type DOUBLE to allow for more accurate output.
Modified BPT_2_CSV function to utilize FIX function instead of CLNG function for rounding.
Long CSV output may be modified to output decimal values for positioning.

04-04-2004:
Modified PDFwrite code to use a private constant for the NewLine character sequence.  Lf is shorter than CrLf.  Smaller PDFs.
The PageRequirements resources could be consolidated to further reduce file size.

04-02-2004:
Save As PDF works.  HA!  Less than a year.

03-31-2004:
More accurate PDF resource consolidation.  (could still be expanded to differentiate Type1 fonts from other fonts).

03-29-2004:
Added X,Y hot-tracking of cursor over page in Viewer program
Fixed an error in BPT_2_CSV function, causing incorrect calculation of text width.
Fixed an error in the File_GetLongName function.  (Replaced with API.)
Long CSV format completely re-done to accomodate AFP -> CSV -> PDF conversion.
Version 1.0.7

03-25-2004:
Added 'Export Pages' functionality to Viewer program to export multiple pages to TIF (and adjust page size).

03-18-2004:
Overlay options added to Viewer program.  This is mostly for testing Image_2_DC functions, but also a useful feature.
KeepOnTop option added to Viewer program.
PDFwrite_AddPageObject_Rect now works.
PDFwrite_ functions no longer allow adding a resource in the middle of a page stream (destroying the document).
PDFwrite_CloseFile and PDFwrite_BeginPage automatically call PDFwrite_EndPage if a stream is still open (instead of destroying the document).

03-17-2004:
PDFwrite_AddRes_ functions now verify that the selected ResourceIDname is not already in use.
PDFwrite_AddRes_ functions now allow an object to be mapped to many resourceIDs via automatic resource consolidation.  YEP.
MRUlist in Viewer program is now 8 entries, instead of 4.

03-16-2004:
PDFwrite_AddRes_FromPDFfile works.  In other words, resource importing works.
PDFwrite_AddPageObject_Text and PDFwrite_AddPageObject_ImageRef now support rotation (clockwise).
PDF Resource Path added to Viewer program.

03-14-2004:
Form names and Form filenames in Viewer program are now self-describing.  No more Form1, Form2, etc.
Basic slideshow options added to Viewer program.  No more hidden slide-show button for testing memory.

03-13-2004:
hDC_DrawText now (finally) draws text with a transparent background, via the SetBkMode API.
90% of modForms moved to API code.

03-12-2004:
PDFwrite_BeginPage no longer requires imageArray or fontArray.  Hello linear-output of PDF data and easy programming.
PDFwrite_BeginPage automatically tracks page Resources and ProcSets (specified as a reference now).
Fixed JPEGfile_GetInfo to allow all variations of StartOfFrame marker in JPEG file.
modPDF functionality has FINALLY been done correctly.  modPDF is now the third largest module in the DLL.

03-11-2004:
JPEGfile_GetInfo function added to modImageFiles.
PDFwrite_AddRes_JpegFile (part of modPDF) now works with all Jpeg files.

03-10-2004:
All arrays LBound=0.
All DLL declarations now specify data types.  No more 'As Any'.
All Clipboard code is now API based (modClipboard).  No more use of the public Clipboard object.
All uses of VarPtr removed from modAFPDS.  They were unnecessary.
All of the changes listed above are for .NET compatibility.

03-09-2004:
Shape Objects removed from Viewer program, for VB.NET compatibility.  SelectionRect is now an ImageBox.
All undeclared variables (and function returns) found and fixed.
Menus re-done in Viewer program.

03-08-2004:
Page Resource verification now includes sub-resources of resources downloaded from FTP.
Cleaned up image processing functions.  Reduced code size (Reduced EXE size by 16k).

03-06-2004:
Uncompressed BMP images (Win or OS2) can be viewed or used as an overlay, by using the BMPfile_2_DC function.
1 Dimensional Group3 TIF images (either byte order) can be viewed or used as overlay, by using the TIFfile_2_DC function.
This includes multi-page TIF files.

03-03-2004:
PDFwrite functions now operational.  Output of PDF file containing pages, colored text, lines, and type1 fonts.
Viewer program interface now uses system colors, instead of hard-coded colors.

02-28-2004:
Enable/Disable of Resource paths now works.
Fixed the KeyDown problem with the Zoom combobox (pressing PageUp/PageDown caused Zoom to change).

02-25-2004:
Fixed a precision error in DC_2_PicBox, when displaying a grid.
Added Zoom:Fit-Width to Viewer program.

02-24-2004:
Recursive function PDFread_GetResourceRequirements works.
Added grid functionality to DC_2_PicBox function.

02-22-2004:
New DC_2_PicBox function.  Faster, and max zoom is now 32,767%, instead of 400%.
Next up for AFP:  More IOCA, followed by BNG, TLE, BDI.

02-17-2004:
Added code for retreiving the initial comments (if any) at the top of an AFP file.
Fixed the KeyPreview problem with the Page_Of_ textbox.  (pressing Home/End in textbox caused page-jump.)

02-06-2004:
Core PDFread functions finally acceptable.
Recursive function PDFread_GetPagetreeInfo works.

02-02-2004:
PDFread and PDFwrite code started fresh.

01-31-2004:
Fixed a couple of Type-o's in the AFPread_GetPageRequirements function.  It's a good thing i caught these.

01-28-2004:
Removed all fixed limits on internal resource-arrays.

01-24-2004:
Re-designed interface (blatant Acrobat knock-off).  No more PageCount ComboBox overflow problems.
I like the idea of calling it Afprobat.

01-21-2004:
Fixed an error in hFTP_GetFile function, which caused file-times to be reset.
Temporary files created by the Viewer program (for text search/selection) now have unique names.
Added support for FQN replacing first Resource ID for BPG, BDT, BIM, BMO, BPT.

01-19-2004:
Recursive function AFPread_GetPageRequirements now works.
EXE size = 400k.
Major updates to DLL code.

01-18-2004:
Fixed error in the baseline coordinate calculation for text in the Default font.

01-15-2004:
IOCA support for Compression=None completed.  Works on the 1 sample I have.
hDC_DrawRasterData modified heavily.  This function now utilizes a ColorTable, and can be used to draw an image in chunks.
Modified OLE-Drop code to release OLE upon receiving it, instead of when loading is complete.

01-14-2004:
UnderLine works now, for Raster fonts, and Default font.

01-13-2004:
Byte combining is no longer a MULT function ( * (256 ^ bytepos) ).  Replaced with MOV (CopyMemory API).
Dependency modStrings removed.
Corrected an error with the DefaultCharacter mapping.

01-09-2004:
Added support for Set Extended Text Color (SEC).  Types:  OCA, RGB, CMYK.  no CIELab or Highlight yet.
Corrected BaseLineRule and InLinRule positions (previously off by 1 pixel).

01-08-2004:
Created Control Sequence functions (AFPcs_) for nearly all PTOCA control sequences.

01-07-2004:
Obtained most current AFP Reference Manuals.

01-06-2004:
Old FTP code replaced with new hFTP code in modFTP.  Result:  Faster FTP search/download.

01-02-2004:
AFPwrite_ BRG, Resource, ERG, BDT, BPG, MCF1, MCF, PTX, EPG, EDT, NOP done.
Fixed error in MRU code, when paths were specified in short format (DOS 8.3 format).

12-31-2003:
BPG functions now support MediumMap referenced in BPG triplets.

12-30-2003:
MCF functions now support CodePage and CharSet arrays, as well as CodedFont.

12-29-2003:
AFPfile_ functions now structured as AFPread_ and AFPwrite_.
No more INI file - basic registry replacement.  ALL settings now saved per user logged on to Windows.

12-15-2003:
Rewrote BPG_2_CSVshort - Now BPG_2_CSV.  Supports rotation, colors, and short/long data format.
Version 1.0.6

12-14-2003:
Fixed a type-o or two.
Organized variables in function calls in AFPImages module.

12-08-2003:
Added MRU (recent docs) list to File menu in Viewer program.

12-07-2003:
Text selection in Viewer program now extremely accurate, to within a couple pixels.

12-06-2003:
PageSegments, MediumMaps, MediumOverlays, PageOverlays, all supported recursively.
X/Y offset and X/Y dpi supported.  Recursive Rotation unsupported.

11-30-2003:
BPG_2_Text redone.  Now called BPG_2_CSVshort (for short format - no UL, OS, rotation, color, lineart, etc).
SearchForText code and CopyText code modified as a result of the above change.

11-27-2003:
Cleaned up code (a little).
Modified DrawBaselineRule and DrawInlineRule code to use PTXcolor.  DBR and DIR still not perfect, explained in PTOCA PDF.

11-26-2003:
Rewrote code for MediumMaps.
Support for pages defined as 1440dpi taken care of.
Added some support for Outline fonts - uses Default font for now.

11-25-2003:
Added basic support for Page Segments and Overlays.
Modified BPG_2_DC and BII_2_DC functions for image scaling and image offset in recursion.

11-23-2003:
Added a bunch of CopyMemory code to accelerate repeated byte conversions.

11-19-2003:
PageDef code added.  InvokeMediumMap support added.  Untested with unmathcing IMM and PGD dimensions.
No PageDef Rotation/Orientation or X/Y Offset code written yet.  Need samples.
Added support for PageSegment objects.  85% complete - untested.
CreateFileAssociation code re-enabled (hence, fixed).
DefaultFont is now CourierNew 9pt.  Must be TTF to rotate with CreateFont API.  (Stupid Windows.)
Text drawn with default font now appears BLUE.
Re-did hFont code in image processing module.  DefaultFont Rotation now works.
DrawText functions now faster.
Added option to disable missing resource warnings.

11-18-2003:
DefaultFont is now Courier 12pt.  Not Times New Roman.  Much better.

11-11-2003:
Fixed error in Page_2_Text function, causing infinite loop on zero-length PTX text.

11-10-2003:
Modified BPT processing functions to utilize "SpaceChar Increment" specified in FNO.
Modified BPT processing functions to utilize "Variable Space Increment" in PTX.
Modified GetInLineResourceArray function to use AFP_RES_ARRAY for faster searching.

11-07-2003:
Recursive function to import resources/sub-resources from a PDF completed.  (for now.)
Added support for colored text in PDFwrite.

11-04-2003:
Started functions to Convert AFP to PDF.

10-30-2003:
Optimized BPT_2_DC function.  Less open/close of character sets.
Modified Page_2_Text function in DLL to return a string.  New function name is Page_2_CSVstring.
Restructured internal AFPFont datatype.

09-24-2003:
Added function to return the names of resources required by a CodedFont (CodePage, CharSet).  GetFontResourceRequirements.

09-22-2003:
Optimized hDC_2_TIF_G3 function.  16% faster now.
Modified BPT_2_DC function to draw default character, instead of assuming space character.
Modified BPT and CodePage processing functions to retain SpaceCharVal as a nonprinting character.

09-19-2003:
Cancelling a search now works.
Minor optimizations.

09-17-2003:
Fixed error in UpdateDIRcombo function when the selected path was a root path (C:\, D:\, etc).

09-13-2003:
Optimized hDC_DrawRasterData function.  22% faster now.

09-11-2003:
Modified code in About screen of Viewer program to prevent application tampering.

09-07-2003:
Viewer program now also saves/restores the previous zoom value.

09-05-2003:
Minor optimizations.
Added CopyFileTo and MoveFileTo functionality to application.  (like WinZip)
Created new application icon.  Much better.

09-04-2003:
Viewer program now keeps default SavePath and OpenPath separate.
Added SelectAll functionality to Viewer program.
Minor changes to interface of Viewer program.
Modified heuristics in BPT_2_Text function to check DefaultCharVal of 32/64 for ascii/ebcdic detection.
Text of unknown font still uses old heuristic (IsTextEbcdic) and DOES NOT default to ascii.

08-30-2003:
Modified hDC_Create and hDC_Destroy functions.  Old BMP handles are now managed behind the scenes.
*This change will require modifications to any code using the DC_KILL or DC_MAKE functions of the ImageDLL.

08-28-2003:
Added color support for IM-Images. 
EXE size = 272 k.  Current memory usage:  3-8 megs for app, 32megs for 8.5x14x300dpi image.
8.5 x 300 = 2550.  14 x 300 = 4200.  4200 x 2550 = 10,710,000 pixles.  3 bytes (24bits) per pixel.  10,710,000 x 3 = 32,130,000 bytes.

08-26-2003:
TextSelection / CopyText code for Viewer program completed.  Piece of cake.
Version 1.0.5

08-25-2003:
Changes to resource paths in Viewer program now take affect when settings are saved (instead of only on Load).
Modified core functions AFPfile_ReadField and MidFile to accept an optional pre-opened filenumber.
If an invalid local resource path (or no path) is specified, AppPath (or DLLPath) is used for resources in Viewer program.

08-24-2003:
Added code to save/restore previous application window size, position, and window-state.

08-22-2003:
Fixed error in HuffmanRunLengthCode look-up routine when runlength was greater than 2623.
Modified core function GetPageOffsetArray to accept AFP image resource files as single-page AFP files.

08-13-2003:
Fixed error in font resource look-up routine, causing display error when codepage or charset was embedded and coded font was external.

08-12-2003:
Redesigned Properties window.  Added more page information, including font list and page name.
Added SetFileAssocation option.
Modified GetTextWidth functions.
Adjusted DrawText function to draw TTF text above the baseline.
Added support for PgUp, PgDn, Home, and End keys, and Ctrl+ shortcuts to menu items.
Started text-selection code.

07-29-2003:
Added full support for FTP resource path.  Slow, but useful.
modAFPDS module much cleaner and more efficient.

07-24-2003:
Rewrote Decimal_2_Binary function again.  Seems faster.
Rewrote undimensioned array code in core AFP functions.
Found and fixed an error in DC_2_TIF function, when a row ended on a black dot.

07-22-2003:
Created DC_2_Printer function in core module.  Moved all print code to core functions.
Started cleaning modAFPDS module.  This will suck.

07-21-2003:
Cleaned up BPT/PTX and CurrX/CurrY code in core functions.
Set zoom to use formula:   100% = screenDPI/PageDPI * 100.

07-20-2003:
Text Orientation completed (for now).  Need to test 180', and others.
Adjusted signed integer processing.  hehe, oops!
Average page processing time: 3.5 seconds, excluding screen drawing.
Text Highlighting in Viewer program does not work for DefaultFont text yet.
Text Orientation in Viewer program does not work for DefaultFont text yet.

07-18-2003:
Working on Text Orientation for core functions.  8 possible orientations.

07-16-2003:
Added Text Highlighting to core functions.  Added Find Text functionality.
DefaultFont code completed.  Automatically assumes Times New Roman 10pt.  oh well.  may change to Courier.

07-15-2003:
Working on support for text with no font (printer default). 

07-11-2003:
TrueType Font Mapping completely removed.
Writing code to convert Windows TTF to AFP CodedFont, CodePage, and CharSet. 50% complete.
CommandLine options completely removed.  Only filename can be specified now.

07-09-2003:
SaveAsText code completed (for now).  May rename to SaveAsCSV.
afpText_2_AFP Function completed - Generates AFP!!
Save As Bitmap code removed for now, until it's re-written.
7000+ lines of code.
'AFP DLL', now 'ImageDLL', is functional.

07-08-2003:
Code re-vamp completed.  Functions are now faster, cleaner, and less dependent.  Almost DLL ready.
BPG conversions no longer return page dimensions (use GetPageDimensions instead).
Added support for basic PTX text color.
Version 1.0.4

07-07-2003:
Fixed error in PTX LineArt code for LineArt of a negative width.
Optimized Ascii/Ebcdic conversions with tables.

07-03-2003:
AFP DLL started. 

06-30-2003:
Code re-vamp underway.  Preparing for AFP DLL.
Zoom too large causes image error. 



--
--



06-10-2003:
Condensed 30+ functions into 6.  Cleaned up code.
Preparing for Orientation/Rotation and IOCA code.
Rewrote DC_2_PicBox sub.  WAY BETTER.  Scroll-Bars now enabled.  Removed FitToWindow Zoom option.
Version 1.0.3

06-09-2003:
Minor changes to interface code, both Cosmetic and Functional.

06-08-2003:
FillWidth/FillHeight code fixed for IM-Images.

06-07-2003:
Unknown characters are now processed as the Default Character, usually SPACE.
Changed ImageFiles module to accelerate constant table look-ups.
Added code to allow browsing of pages WHILE the file is still loading.  GO ME.
Wow.  No known bugs.  Just incomplete code.

06-05-2003:
Located type-o in Modified Huffman code, corrupting Group3 TIF files.  Fixed.
Experimenting with CopyMemory API to accelerate conversions/transformations.

06-04-2003:
Began code for MediumMaps, in preparation for Rotation/Orientation code.
Began code for IOCA Image support.

05-21-2003:
CommandLine Options now enabled.  File="xx.afp" Page="xx" Offset="xx" Overlay="xx.bmp" ConvertTo="xx.tif" Resources="x:\xxx\xxx"
Overlay code completed.

05-19-2003:
DC_2_TIF_G3_1D code completed.
Created shared module for image processing.

05-17-2003:
BMPfile_2_Tif_G3_1D code completed.  Will convert ANY bitmap file to 1bit Group3 Fax Compressed TIF.
Rewrote Decimal_2_Binary function again, attempting to accelerate.

05-14-2003:
Finally figured out CodePage character mapping of Default Character. 
Version 1.0.2

05-12-2003:
Save As BMP 1bit code completed.

05-10-2003:
Error in CodePage character mapping function FIXED.  HA!



--
--



04-26-2003:
Most of IM-Image code completed.  FillWidth/FillHeight code needs work.

04-25-2003:
Font Character processing completed.  PTX code nearly complete.
Error in CodePage character mapping function.

04-23-2003:
Began code for AFP Resources, both embedded and external.
Spent a day reading about CodePages, CharacterSets, CodedFonts, etc.

04-22-2003:
MapCodedFont code (MCF1, MCF) completely redone.
Consolidated AFP code into single shared module.

04-21-2003:
PTX Line-Art (DrawBaseLineRule, DrawInLineRule) completed.

04-20-2003:
Fixed bugs in AFP Text Display via TTF Map.  Added support for In-Line Margin.
Version 1.0.1

04-17-2003:
AFP Text Display via TTF Map completed.

04-13-2003:
TrueType Font Mapping code completed.

04-12-2003:
Basic interface completed.  Scroll bars not done.

04-10-2003:
Started writing complete AFP Viewer.