AFP to PDF Conversion
QCAD is an open source 2D CAD software for Windows, Linux, and Mac. This software can also be used as a DXF to PDF converter. It lets you open a DXF file and then convert it to a PDF document by using its PDF Export feature. Do remember that DXF drawing should properly align within the canvas. A full suite of options are also available such as encryption, PDF version, splitting, indexing, and much more. Those can be found on the PDF Converter configurations page. Test all finalized configurations by running the process from end to end with the PageMapper and PDF Converter. Evaluate the full AFP to PDF.
This tutorial is intended to demonstrate how to convert AFP documents to PDF files with the help of PDF Server.
NOTE: AFP file can be AFP document, AFP overlay, AFP medium overlay, or AFP page segments.
1. Start the AFP Server Configuration Tool on your server
2. Open an AFP document
3. In the drop-down list of 'Preset Programs', choose 'Convert', and click 'Configure...' button
4. A configuration dialog pops up, and you need to specify the target folder for the PDF files to be created
5. Click 'OK' button to confirm and close the pop-up dialog.
6. Click 'Apply' button to apply your changes.
7. Specify the AFP output folder for AFP files, and close the AFP Server Configuration Tool
8. Congratulations! You have completed the host setup process on your server as guided.
9. Now you can print any type of document, such as Microsoft Word document, to the 'AFP Printer', and in the AFP output folder you get the AFP documents, and in the target folder for the PDF files you get PDF documents as the conversion results.
How to convert AFP to PDF with AcroPDF
1. Start your AFP Workbench Viewer software
2. Open an AFP document
3. Select from main menu 'File'->'Print'
4. Select Printer 'AcroPDF' (If you don't have AcroPDF printer, you can get it from AcroPDF.com)
5. If you need to adjust PDF generation options, click the 'Property' button on the right
6. Click 'OK'
7. A dialog will pop up, specify the location and file name of the PDF document to be generated
8. Congratulations! You have converted AFP to PDF document now.
How to batch convert AFP to PDF with AFP to PDF Converter
1. Download, install, and start AFP to PDF Converter software
2. Add one or more AFP documents
3. Specify the output folder
4. Click Convert button to begin your AFP to PDF conversion in batch
IPDS Printing Solutions company offers a server based afp to pdf conversion software program namely AFP2PDF Transform Server in addition to this desktop application.
System Requirement: Microsoft Windows 10, Windows 8.1, Windows 8, Microsoft Windows 7, Microsoft Windows Vista, Microsoft Windows XP, Microsoft Windows Server 2019, Microsoft Windows Server 2016, Microsoft Windows Server 2012, Microsoft Windows Server 2008, Microsoft Windows Server 2003 R2. Either 64-bit or 32-bit.
Common Conversion Pairs
TIFF to AFP ConversionJPG to AFP Conversion
BMP to AFP ConversionXPS to AFP Conversion
PDF to AFP ConversionAFP to PDF Conversion
Apacheā¢ FOP supports multiple output formats by using a different renderer for each format. The renderers do not all have the same set of capabilities, sometimes because of the output format itself, sometimes because some renderers get more development attention than others.
General Information
Fonts
Most FOP renderers use a FOP-specific system for font registration. However, the Java2D/AWT and print renderers use the Java AWT package, which gets its font information from the operating system registration. This can result in several differences, including actually using different fonts, and having different font metrics for the same font. The net effect is that the layout of a given FO document can be quite different between renderers that do not use the same font information.
Theoretically, there's some potential to make the output of the PDF/PS renderers match the output of the Java2D-based renderers. If FOP used the font metrics from its own font subsystem but still used Java2D for text painting in the Java2D-based renderers, this could probably be achieved. However, this approach hasn't been implemented, yet.
With a work-around, it is possible to match the PDF/PS output in a Java2D-based renderer pretty closely. The clue is to use the intermediate format. The trick is to layout the document using FOP's own font subsystem but then render the document using Java2D. Here are the necessary steps (using the command-line):
Produce an IF file:
fop -fo myfile.fo -at application/pdf myfile.at.xml
Specifying 'application/pdf' for the '-at' parameter causes FOP to use FOP's own font subsystem (which is used by the PDF renderer). Note that no PDF file is created in this step.
Render to a PDF file:
fop -atin myfile.at.xml -pdf myfile.pdf
Render to a Java2D-based renderer:
fop -atin myfile.at.xml -print
fop -atin myfile.at.xml -awt
fop -atin myfile.at.xml -tiff myfile.tiff
Output to a Printer or Other Device
The most obvious way to print your document is to use the FOP print renderer, which uses the Java2D API (AWT). However, you can also send output from the Postscript renderer directly to a Postscript device, or output from the PCL renderer directly to a PCL device.
Here are Windows command-line examples for Postscript and PCL:fop ... -ps computernameprinterfop ... -pcl computernameprinterHere is some Java code to accomplish the task in UNIX:proc = Runtime.getRuntime().exec('lp -d' + print_queue + ' -o -dp -');out = proc.getOutputStream();Set the output MIME type to 'application/x-pcl' (MimeConstants.MIME_PCL) and it happily sends the PCL to the UNIX printer queue.
PDF is the best supported output format. It is also the most accurate with text and layout. This creates a PDF document that is streamed out as each page is rendered. This means that the internal page index information is stored near the end of the document. The PDF version supported is 1.4. PDF versions are forwards/backwards compatible.
Note that FOP does not currently support 'tagged PDF' or PDF/A-1a. Support for PDF/A-1b and PDF/X has recently been added, however.
Fonts
PDF has a set of fonts that are always available to all PDF viewers; to quote from the PDF Specification: 'PDF prescribes a set of 14 standard fonts that can be used without prior definition. These include four faces each of three Latin text typefaces (Courier, Helvetica, and Times), as well as two symbolic fonts (Symbol and ITC Zapf Dingbats). These fonts, or suitable substitute fonts with the same metrics, are guaranteed to be available in all PDF viewer applications.'
Post-processing
FOP does not currently support several desirable PDF features: watermarks and signatures. One workaround is to use Adobe Acrobat (the full version, not the Reader) to process the file manually or with scripting that it supports.
Another popular post-processing tool is iText, which has tools for adding security features, document properties, watermarks, and many other features to PDF files.
Check the iText tutorial and documentation for setting access flags, password, encryption strength and other parameters.
Watermarks
In addition to the PDF Post-processing options, consider the following workarounds:
Use a background image for the body region.
(submitted by Trevor Campbell) Place an image in a region that overlaps the flowing text. For example, make region-before large enough to contain your image. Then include a block (if necessary, use an absolutely positioned block-container) containing the watermark image in the static-content for the region-before. Note that the image will be drawn on top of the normal content.
PostScript
The PostScript renderer has been brought up to a similar quality as the PDF renderer, but may still be missing certain features. It provides good support for most text and layout. Images and SVG are not fully supported, yet. Currently, the PostScript renderer generates PostScript Level 3 with most DSC comments. Actually, the only Level 3 features used are the FlateDecode and DCTDecode filter (the latter is used for 1:1 embedding of JPEG images), everything else is Level 2.
Configuration
The PostScript renderer configuration currently allows the following settings:
The default value for the 'auto-rotate-landscape' setting is 'false'. Setting it to 'true' will automatically rotate landscape pages and will mark them as landscape.
The default value for the 'language-level' setting is '3'. This setting specifies the PostScript language level which should be used by FOP. Set this to '2' only if you don't have a Level 3 capable interpreter.
The default value for the 'optimize-resources' setting is 'false'. Setting it to 'true' will produce the PostScript file in two steps. A temporary file will be written first which will then be processed to add only the fonts which were really used and images are added to the stream only once as PostScript forms. This will reduce file size but can potentially increase the memory needed in the interpreter to process.
The default value for the 'safe-set-page-device' setting is 'false'. Setting it to 'true' will cause the renderer to invoke a postscript macro which guards against the possibility of invalid/unsupported postscript key/values being issued to the implementing postscript page device.
The default value for the 'dsc-compliant' setting is 'true'. Setting it to 'false' will break DSC compliance by minimizing the number of setpagedevice calls in the postscript document output. This feature may be useful when unwanted blank pages are experienced in your postscript output. This problem is caused by the particular postscript implementation issuing unwanted postscript subsystem initgraphics/erasepage calls on each setpagedevice call.
Limitations
Images and SVG may not be displayed correctly. SVG support is far from being complete. No image transparency is available.
Only Type 1 fonts are supported.
Multibyte characters are not supported.
PPD support is still missing.
PCL
This format is for the Hewlett-Packard PCL printers and other printers supporting PCL. It should produce output as close to identical as possible to the printed output of the PDFRenderer within the limitations of the renderer, and output device.
The output created by the PCLRenderer is generic PCL 5, HP GL/2 and PJL. This should allow any device fully supporting PCL 5 to be able to print the output generated by the PCLRenderer. PJL is used to control the print job and switch to the PCL language. PCL 5 is used for text, raster graphics and rectangular fill graphics. HP GL/2 is used for more complex painting operations. Certain painting operations are done off-screen and rendered to PCL as bitmaps because of limitations in PCL 5.
References
Limitations
Text or graphics outside the left or top of the printable area are not rendered properly. This is a limitation of PCL, not FOP. In general, things that should print to the left of the printable area are shifted to the right so that they start at the left edge of the printable area.
The Helvetica and Times fonts are not well supported among PCL printers so Helvetica is mapped to Arial and Times is mapped to Times New. This is done in the PCLRenderer, no changes are required in the FO's. The metrics and appearance for Helvetica/Arial and Times/Times New are nearly identical, so this has not been a problem so far.
For the non-symbol fonts, the ISO 8859-1 symbol set is used (PCL set '0N').
All fonts available to the Java2D subsystem are usable. The texts are painted as bitmap much like the Windows PCL drivers do.
Multibyte characters are not supported.
At the moment, only monochrome output is supported. PCL5c color extensions will only be implemented on demand. Color and grayscale images are converted to monochrome bitmaps (1-bit). Dithering only occurs if the JAI image library is available.
Images are scaled up to the next resolution level supported by PCL (75, 100, 150, 200, 300, 600 dpi). For color and grayscale images an even higher PCL resolution is selected to give the dithering algorithm a chance to improve the bitmap quality.
Currently, there's no support for clipping and image transparency, largely because PCL 5 has certain limitations.
Configuration
The PCL renderer configuration currently allows the following settings:
The default value for the 'rendering' setting is 'speed' which causes borders to be painted as plain rectangles. In this mode, no special borders (dotted, dashed etc.) are available. If you want support for all border modes, set the value to 'quality' as indicated above. This will cause the borders to be painted as bitmaps.
The default value for the 'text-rendering' setting is 'auto' which paints the base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D. If the mix of painting methods results in unwelcome output, you can set this to 'bitmap' which causes all text to be rendered as bitmaps.
The default value for the 'disable-pjl' setting is 'false'. This means that the PCL renderer usually generates PJL commands before and after the document in order to switch a printer into PCL language. PJL commands can be disabled if you set this value to 'true'.
Convert Afp To Pdf Open Source Download
You can control the output resolution for the PCL using the 'target resolution' setting on the FOUserAgent. The actual value will be rounded up to the next supported PCL resolution. Currently, only 300 and 600 dpi are supported which should be enough for most use cases. Note that this setting directly affects the size of the output file and the print quality.
Extensions
The PCL Renderer supports some PCL specific extensions which can be embedded into the input FO document. To use the extensions the appropriate namespace must be declared in the fo:root element like this:
Page Source (Tray selection)
The page-source extension attribute on fo:simple-page-master allows to select the paper tray the sheet for a particular simple-page-master is to be taken from. Example:
Note: the tray number is a positive integer and the value depends on the target printer. Not all PCL printers support the same paper trays. Usually, '1' is the default tray, '2' is the manual paper feed, '3' is the manual envelope feed, '4' is the 'lower' tray and '7' is 'auto-select'. Consult the technical reference for your printer for all available values.
AFP
References
Limitations
This list is most likely badly incomplete.
Clipping of text and graphics is not supported.
Only IBM outline and raster fonts and to a limited extend the original fonts built into FOP are supported. Support for TrueType fonts may be added later.
Configuration
Fonts
The AFP Renderer requires special configuration particularly related to fonts. AFP Render configuration is done through the normal FOP configuration file. The MIME type for the AFP Renderer is application/x-afp which means the AFP Renderer section in the FOP configuration file looks like:
There are 3 font configuration variants supported:
IBM Raster fonts
IBM Outline fonts
FOP built-in Base14 fonts
A typical raster font configuration looks like:
An outline font configuration is simpler as the individual font size entries are not required. However, the characterset definition is now required within the afp-font element.
Experimentation has shown that the font metrics for the FOP built-in Base14 fonts are actually very similar to some of the IBM outline and raster fonts. In cases were the IBM font files are not available the path attribute in the afp-font element can be replaced by a base14-font attribute giving the name of the matching Base14 font. In this case the AFP Renderer will take the font metrics from the built-in font.
Output Resolution
By default the AFP Renderer creates output with a resolution of 240 dpi. This can be overridden by the
Images
By default the AFP Renderer converts all images to 8 bit grey level. This can be overridden by the
This will put images as RGB images into the AFP output stream. The default setting is:
Only the values 'color' and 'b+w' are allowed for the mode attribute. The bits-per-pixel attribute is ignored if mode is 'color'. For 'b+w' mode is must be 1, 4, or 8.
Extensions
The AFP Renderer supports some AFP specific extensions which can be embedded into the input fo document. To use the extensions the appropriate namespace must be declared in the fo:root element like this:
Page Overlay Extension
The include-page-overlay extension element allows to define on a per simple-page-master basis a page overlay resource. Example:
The mandatory name attribute must refer to an 8 character (space padded) resource name that must be known in the AFP processing environment.
Page Segment Extension
The include-page-segment extension element allows to define resource substitution for fo:external-graphics elements. Example:
The include-page-segment extension element can only occur within a simple-page-master. Multiple include-page-segment extension elements within a simple-page-master are allowed. The mandatory name attribute must refer to an 8 character (space padded) resource name that must be known in the AFP processing environment. The value of the mandatory src attribute is compared against the value of the src attribute in fo:external-graphic elements and if it is identical (string matching is used) in the generated AFP the external graphic is replaced by a reference to the given resource.
Tag Logical Element Extension
The tag-logical-element extension element allows to injects TLEs into the AFP output stream. Example:
The tag-logical-element extension element can only occur within a simple-page-master. Multiple tag-logical-element extension elements within a simple-page-master are allowed. The name and value attributes are mandatory.
No Operation Extension
The no-operation extension provides the ability to carry up to 32K of comments or any other type of unarchitected data into the AFP output stream. Example:
The no-operation extension element can only occur within a simple-page-master. Multiple no-operation extension elements within a simple-page-master are allowed. The name attribute is mandatory.
RTF
JFOR, an open source XSL-FO to RTF converter has been integrated into Apache FOP. This will create an RTF (rich text format) document that will attempt to contain as much information from the XSL-FO document as possible. It should be noted that is not possible (due to RTF's limitations) to map all XSL-FO features to RTF. For complex documents, the RTF output will never reach the feature level from PDF, for example. Thus, using RTF output is only recommended for simple documents such as letters.
The RTF output follows Microsoft's RTF specifications and produces best results on Microsoft Word.RTF output is currently unmaintained and lacks many features compared to other output formats. Using other editable formats like Open Document Format, instead of producing XSL-FO then RTF through FOP, might give better results.These are some known restrictions compared to other supported output formats (not a complete list):
Not supported/implemented:
break-before/after (supported by the RTF library but not tied into the RTFHandler)
fo:page-number-citation-last
keeps (supported by the RTF library but not tied into the RTFHandler)
region-start/end (RTF limitation)
multiple columns
Only a single page-master is supported
Not all variations of fo:leader are supported (RTF limitation)
percentages are not supported everywhere
XML (Area Tree XML)
This is primarily for testing and verification. The XML created is simply a representation of the internal area tree put into XML. We use that to verify the functionality of FOP's layout engine.
The other use case of the Area Tree XML is as FOP's 'intermediate format'. More information on that can be found on the page dedicated to the Intermediate Format.
Java2D/AWT
The Java2DRenderer provides the basic functionality for all Java2D-based output formats (AWT viewer, direct print, PNG, TIFF).
The AWT viewer shows a window with the pages displayed inside a Java graphic. It displays one page at a time. The fonts used for the formatting and viewing depend on the fonts available to your JRE.
It is possible to directly print the document from the command line. This is done with the same code that renders to the Java2D/AWT renderer.
Known issues
If you run into the problem that the printed output is incomplete on Windows: this often happens to users printing to a PCL printer. There seems to be an incompatibility between Java and certain PCL printer drivers on Windows. Since most network-enabled laser printers support PostScript, try switching to the PostScript printer driver for that printer model.
Bitmap (TIFF/PNG)
It is possible to directly create bitmap images from the individual pages generated by the layout engine. This is done with the same code that renders to the Java2D/AWT renderer.
Currently, two output formats are supported: PNG and TIFF. TIFF produces one file with multiple pages, while PNG output produces one file per page. The quality of the bitmap depends on the target resolution setting on the FOUserAgent.
Configuration
The TIFF and PNG renderer configuration currently allows the following settings:
The default value for the 'transparent-page-background' setting is 'false' which paints an opaque, white background for the whole image. If you set this to true, no such background will be painted and you will get a transparent image if an alpha channel is available in the output format.
TIFF-specific Configuration
In addition to the above values the TIFF renderer configuration allows some additional settings:
The default value for the 'compression' setting is 'PackBits' which which is a widely supported RLE compression scheme for TIFF. The set of compression names to be used here matches the set that the Image I/O API uses. Note that not all compression schemes may be available during runtime. This depends on the actual codecs being available. Here is a list of possible values:
NONE
(no compression)PackBits
(RLE, run-length encoding)JPEG
Deflate
LZW
ZLib
CCITT T.4
(Fax Group 3)CCITT T.6
(Fax Group 4)If you want to use CCITT compression, please make sure you've got a J2SE 1.4 or later and Java Advanced Imaging Image I/O Tools in your classpath. The Sun JRE doesn't come with a TIFF codec built in, so it has to be added separately. The internal TIFF codec from XML Graphics Commons only supports PackBits, Deflate and JPEG compression for writing.
Afp To Pdf Converter Open Source
TXT
The text renderer produces plain ASCII text output that attempts to match the output of the PDFRenderer as closely as possible. This was originally developed to accommodate an archive system that could only accept plain text files, and is primarily useful for getting a quick-and-dirty view of the document text. The renderer is very limited, so do not be surprised if it gives unsatisfactory results.
The Text renderer works with a fixed size page buffer. The size of this buffer is controlled with the textCPI and textLPI public variables. The textCPI is the effective horizontal characters per inch to use. The textLPI is the vertical lines per inch to use. From these values and the page width and height the size of the buffer is calculated. The formatting objects to be rendered are then mapped to this grid. Graphic elements (lines, borders, etc) are assigned a lower priority than text, so text will overwrite any graphic element representations.
Because FOP lays the text onto a grid during layout, there are frequently extra or missing spaces between characters and lines, which is generally unsatisfactory. Users have reported that the optimal settings to avoid such spacing problems are:
font-family='Courier'
font-size='7.3pt'
line-height='10.5pt'
Output Formats in the Sandbox
Convert Afp To Pdf Open Source File
Due to the state of certain renderers we moved some of them to a 'sandbox' area until they are ready for more serious use. The renderers and FOEventHandlers in the sandbox can be found under src/sandbox and are compiled into build/fop-sandbox.jar during the main build. The output formats in the sandbox are marked as such below.
MIF
Convert Afp To Pdf Open Source Free
SVG
Convert Afp To Pdf Open Source
Wish list
Apache FOP is easily extensible and allows you to add new output formats to enhance FOP's functionality. There's a number of output formats which are on our wish list. We're looking for volunteers to help us implement them.
- ODF (Open Document Format): The standardized successor to OpenOffice's file format.