With scConverter you can add annotations like stamps, text, barcodes, images and much more to the converted output files.
In this tutorial we will look at a few samples on how you can add such annotations, also called markup, to your files.
scConverter provides 3 functions that can add annoations during conversion:
Each of these functions accepts a string parameter for markup input.
This string may either be a fully qualified file name, or it may contain markup XML data.
The given file may contain binary markup data, which can be created by ViewCompanion and scViewerX, or markup XML data.
Here is how you call the ConvertMarkup function with a markup file name:
ConvertMarkup( "c:\input\in.pdf", "c:\input\stamp.scmx", "c:\output\stamp.pdf", "PDF", 1.0, 24, 300 );
The stamp.scmx file contains the XML data required to add a stamp to the output file and it looks like the following:
This XML code will add a stamp at center of the page with a rotation of 45 degrees with the text "APPROVED".
As you can see both width and height are set 50% which will place it at the center.
You can optionally put the XML code into a string variable and then call the same function like this:
Both calls will generate the following output PDF file:
To add a barcode image to your converted files you may use the following XML (barcode.scmx):
This XML code will add a barcode at center of page width and 25 mm above bottom.
The width and height of the QR image is set to 25mm.
The Page is set to -1, and this will force the annotation element to be added to all pages in a file.
The resulting PDF file will look like the following:
To add a watermark to your converted files you may use the XML text defintion with transparency as shown below (watermark_rotated.scmx):
This XML code will add a rotated watermark text at the center of the page.
The Page is set to -1, and this will force the annotation element to be added to all pages in a file.
The resulting PDF file will look like the following:
The sample XML files used above, and more, can be found in the SDK installation Markup XML folder:
C:\Users\Public\Documents\ScConverter SDK\Markup XML
You can also find sample XML files in GitHub:
scConverter GitHub repository.
You can check the following links to read more about scConverter:
scConverter Product Description
scConverter Frequently Asked Questions
Software Companions Markup XML format specification