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.
his string may either be a fully qualified file name, or it may contain markup XML data.
The 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\out.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:
The sample XML files used above and more examples, can be found in the SDK Markup XML sample folder:
C:\Users\Public\Documents\ScConverter SDK\Markup XML