- Home
- Forum
- ASP.NET Core - EJ 2
- Unwanted fonts on PDF/A3 converted document
Unwanted fonts on PDF/A3 converted document
Hi,
I'm using the following code to print a word document into a PDF/A3 one. Unfortunately every time I run this code with a single line document with arail font I get a Helvetica Font added to my PDF. The fact is I DO NOT want the Helvetica font on my PDF because it is not embbeded. How can I do that ?
Here is the Font description from Adobe Reader :
Here is my code
using (FileStream fileStreamPath = new FileStream(Path.GetFullPath(wordpath), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) {
using (WordDocument document = new WordDocument(fileStreamPath, FormatType.Docx)) {
document.FontSettings.SubstituteFont += new SubstituteFontEventHandler(SubstituteFont);
DocIORenderer render = new DocIORenderer();
render.Settings.PdfConformanceLevel = PdfConformanceLevel.Pdf_A3B;
render.Settings.EmbedFonts = true;
render.Settings.AutoDetectComplexScript = false;
render.Settings.EmbedCompleteFonts = true;
// Convert Word to PDF
using (PdfDocument pdfDocument = render.ConvertToPDF(document)) {
using (FileStream outputFileStream = new FileStream(Path.GetFullPath(pdfpath), FileMode.Create, FileAccess.ReadWrite)) {
pdfDocument.Attachments.Add(xml);
pdfDocument.Save(outputFileStream);
}
}
render.Dispose();
document.Dispose();
}
}
}
Hi pofje,
Thank you for reaching out to us.
We understand your scenario: your input document contains a single line of text
with the Arial font applied. However, the generated output PDF document
includes additional fonts such as Helvetica. We suspect this may be due to a
licensing watermark being added to the output PDF, which requires the Helvetica
font to preserve the watermark text. When using a valid license key to generate
the output PDF, the licensing watermark should not appear, and only the Arial
font should be displayed in the output document.
If your generated output PDF document using a license key still shows the same
issue, kindly share the following details to help us reproduce the exact
problem at our end:
1. The input document.
2. Output PDF document generated at your end (helpful to investigate about the
problem).
3. Environment details (Operating system, if any cloud or docker means, share
configuration and plan details).
Regards,
Karan.