We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Issue rendering a font

I am running into an issue rendering a font in a PDF file. The font I’m using is used to render barcodes. I am using Adobe Acrobat Pro to create the file. In Acrobat, I add a field and set the font to the barcode font (Skandata). I set the text to “123RC123” It looks fine in Acrobat. Even if I print it, it still looks fine.

The issue is that I am using PdfConverter in Aspose.Pdf.Kit to convert it to a bitmap and display it inside my application. When I do that, the “RC” in the barcode is showing up as blank space. I’ve uploaded a screenshot of what the font looks like when it is rendered. In the screen shot just below the barcode are the characters from the barcode in plain text. I have also included the font file I am trying to render.

Do you have a work around for this issue?

I am using Aspose.Pdf.Kit 5.2.0.0

Here is a snipped of the code I am using to convert the PDF form to an image.

Public Function ConvertPDFStreamToImages(ByRef htImages As Hashtable, ByRef objPDFStream As Stream, ByRef strErrMsg As String) As Boolean
Dim blnRetVal As Boolean = True
Dim objImageStream As Stream = Nothing
Dim objImage As System.Drawing.Image = Nothing
Dim converter As PdfConverter = New PdfConverter()
Dim imageCount As Integer = 0

Try

'Now that the form is filled out, we need to convert it to a set of images
'so we can display then in a picturebox.
htImages = New Hashtable


converter = New PdfConverter()
converter.BindPdf(objPDFStream)
converter.DoConvert()
'Loop through all of the pages in the PDF
While converter.HasNextImage() '***GETTING ERROR MESSAGE “System.IO.IOException: pages are corrupt or too many pages”
'Save the image to a stream
objImageStream = New MemoryStream
converter.GetNextImage(objImageStream)
'Convert the stream to an image
objImage = System.Drawing.Image.FromStream(objImageStream)
imageCount = imageCount + 1
'Add the image to a hashtable
htImages.Add(imageCount.ToString, objImage)
End While

Catch ex As Exception
blnRetVal = False
strErrMsg = ex.ToString
End Try

Return blnRetVal
End Function


thanks,

Mike

Hi Mike,

Please share the input PDF file with us as well, so we could reproduce the issue over here. You’ll be updated with the results accordingly.

We’re sorry for the inconvenience.
Regards,

At the top of the PDF file I sent you is a text box that contains the following expression.

literal()lookup(followup_contact1.packetid)literal(0105)padzeros(followup_contact1.outseq,2)literal()

Our code parses this expression and uses the Form.FillField() method to populate this text box with a string such as “12345RC12345”. Since the font on the text box is set to a bar code font, the text is rendered as a bar code. When converted to a bitmap by PDFConverter, everything in the string is rendered correctly except for the letters “RC”. However, the letters in the bar code are rendered correctly when viewed in Adobe reader.

Thanks,

Mike

This issue is resolved. My code was converting the letters to lower case. If they remain in upper case, then it works just fine.

Hi Mike,

I’m glad to know that this issue is resolved at your end. If you find any further questions then please do let us know.

Regards,