- How to add page numbers to your PDF
- Add text field to PDF
- Append multiple PDF documents
- Bulleted list from XML and XSL
- Merge PDF
- Calculate the height of a paragraph in PDF
- Multipage TIFF to PDF
- Convert TXT to PDF
- Convert XHTML to PDF
- Create PDF in C# - Tall Components - Check out our PDF code samples
- Text formatting
- Generate PDF form from XML
- Generate PDF with local images from XML with Xamarin.iOS
- XhtmlParagraph and TrueType fonts
- Add footer with left and right aligned text on same line
- Read and write meta data from PDF
- Stitch PDF documents
- Use multiple licenses
- What is the resulting fontsize in PDF rich text used in SimpleXhtmlShape
Use multiple licenses
This code sample explains how to register multiple license keys with a single application.
Here is the web.config that includes a single license key for a pdfkit4 Server license:
<configuration>
<appSettings>
<add key="PDFKit.NET 4.0 Server Key" value="7206:JUm8jYm-4bwE84gi8RtQuk++" />
</appSettings>
</configuration>
Now suppose that this web.config file is part of a project that is used to deploy to two different servers. In that case, it is possible to add a second key to the same web.config. Because a config file behaves like a dictionary, you must make the key attribute unique by adding a postfix. Our licensing code only checks if the key attribute starts with the expected string so the postfix may be anything. It will check all licenses until verification succeeds.
Here is the web.config file with the second key added:
<configuration>
<appSettings>
<add key="PDFKit.NET 4.0 Server Key SVR001" value="7206:JUm8jYm-4bwE84gi8RtQuk++" />
<add key="PDFKit.NET 4.0 Server Key SVR002" value="3070:5RwUiW1lHWFEcteNiQFTy+++" />
</appSettings>
</configuration>
Note the postfix of the key attribute. Although it can be anything, it is recommended to use something that makes sense.