itextpdf-generationocr

iTextSharp 5: Create image from text


I am using iTextSharp (C#) to generate a few PDF-reports.

One of them creates a bill. The bill must contain one line in OCR-B. I cannot embed the font file.

Since im doing the new reports after the old ones, I went to check how it was done in the old bill-report. They inserted a picture.

old bill-report

Seems like a good workaround.

I have been googling on how to render text as image using iTextSharp, without success.

I am open for suggestions.


Solution

  • Apparently, there is no iTextSharp way of doing this.

    This approach worked for me How to generate an image from text on fly at runtime

    That way I didn't have to include any 3rd party libraries.