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

Free Support Forum - aspose.com

Font issues when adding text stamp to Image PDF document

I am having issues adding a text stamp to an Image PDF document. I do not receive any errors during the process of adding the text stamp. The error comes when the user opens the PDF document and they receive the following error message “Cannot find or create the font ‘TMKQKI+Arial’. Some characters may not display or print correctly”. If the PDF document is a text PDF, the users do not receive the error. Below is the code that I am using to add the text stamp. I am currently using Aspose.PDF v10.5. Any help on why this is happening would be greatly appreciated.


private MemoryStream AddTextStamp(Stream strPDF, string sPDFTxtStamp)
{
using (Aspose.Pdf.Document origPDF = new Aspose.Pdf.Document(strPDF))
{
aPDF.TextStamp txtStamp = new aPDF.TextStamp(sPDFTxtStamp);

txtStamp.VerticalAlignment = aPDF.VerticalAlignment.Top;
txtStamp.HorizontalAlignment = aPDF.HorizontalAlignment.Right;
txtStamp.TextState.Font.IsEmbedded = true;
txtStamp.TextState.Font = FontRepository.FindFont(“Arial”);
txtStamp.TextState.FontSize = 12.0F;
txtStamp.Opacity = 0.5;

foreach (Aspose.Pdf.Page pdfpage in origPDF.Pages)
{
pdfpage.AddStamp(txtStamp);
}

MemoryStream mem = new MemoryStream();

origPDF.Save(mem);
return mem;

}
}

Hi Rene,


Thanks for your inquiry. We will appreciate it if you please share your sample input/output PDF documents here, so we will look into these and guide you accordingly.

We are sorry for the inconvenience caused.

Best Regards,

I have attached the PDF document before and after the watermarking process is performed. Let me know if you need anything else to assist with the issue.


Thanks

Hi Rene,

Thanks for sharing source document. I have tested your scenario with shared document using Aspose.Pdf for .NET 10.8.0 and managed to observe the reported issue. For further investigation, I have logged an issue in our issue tracking system as PDFNEWNET-39375 and also linked your request to it. We will keep you updated via this thread regarding the issue status.

We are sorry for the inconvenience caused.

<span style=“font-size:10.0pt;line-height:115%;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:Calibri;color:#333333;mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>Best Regards,

If at all possible, could you provide a time table when this would be corrected? This is a production solution and it is preventing our clients from completing their tasks on these PDF’s.


Thanks
wscane:
If at all possible, could you provide a time table when this would be corrected? This is a production solution and it is preventing our clients from completing their tasks on these PDF's.
Hi Rene,

As we recently have been able to notice this issue, so development team requires little time to investigate and figure out the reasons of this problem. Nevertheless, as soon as we have made some definite progress towards its resolution, we would be more than happy to update you with the status of correction. Our humble request is to please be patient and spare us little time.


However I have shared your concerns with product team and they will surely consider them during the issue resolution.

Thanks Nayyer for sharing my concerns. I greatly appreciate it.

Is there any update to this issue? As I have said in a previous post, this is affecting a solution that is in production.


Thanks

Hi Rene,


Thanks for your inquiry. I am afraid your above reported issue is still not resolved as product team is busy in resolving other issues in the queue, reported earlier. We have recorded your concern and will notify you as soon as we made some significant progress towards issues resolution.

We are sorry for the inconvenience caused.

Best Regards,

Is there any updated on this issue? As I have said in a previous post, this is a production issue. It has been three months now since this has been reported and I have not seen an update on this issue.


Thanks

Arthur

Hi Arthur,


Thanks for your patience.

The issue reported earlier is still pending for review as the team has been busy fixing other previously reported high priority issues. However I have shared your concerns with product team and have asked them to try accommodating its investigation in their development schedule. As soon as we have some definite updates, we will let you know.

Your patience and comprehension is greatly appreciated in this regard.

Hi Arthur,


Thanks for your patience. Our product team has investigated the issue and found its known issue.

As your PDF document version is 1.1 and it does not support Arial font. When Aspose.Pdf inserts fonts into PDF it creates font from one of 2 types - Type1 and Type0. Type1 font set is small and consist of 14 obsolete fonts. All other fonts including Arial are of type Type0. Aspose.Pdf uses special feature for these Type0 fonts - ToUnicode Cmap. This feature is only supported in PDF version 1.2 and higher.

So as your document has PDF version 1.1 so TextStamp with Arial font corrupts it. There are two solutions either convert your PDF version to any higher PDF version and add TextStamp with Arial font or to use any of following fonts for TextStamp instead of Arial with PDF version 1.1:

Times-Roman, Helvetica, Courier, Times-Bold, Helvetica-Bold, Courier-Bold, Times-Italic, Helvetica-Oblique, Courier-Oblique, Times-BoldItalic, Helvetica-BoldOblique, Courier-BoldOblique. Also fonts as Symbol, e.g. ZapfDingbats can be used but these fonts have only special symbols and have no traditional latin letters.

Please feel free to contact us for any further assistance.

Best Regards,