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

Free Support Forum - aspose.com

Barcode font not displayed - Converting Word to PDF using Aspose.Words.dll

Hi i am using Aspose.Words.dll to convert word Doc to PDF

Here is my code

var fileName = System.AppDomain.CurrentDomain.BaseDirectory + Guid.NewGuid().ToString();
File.WriteAllBytes(fileName + ".docx", wordBytes);
var doc = new Aspose.Words.Document(fileName + ".docx");
doc.Save(fileName + ".pdf");

If i run the above code it successfully convert Word to PDF but my problem is i have barcode font in my word but that was not show as barcode in PDF. It display the word.

I have tried like below also,

var saveOptions = new PdfSaveOptions();
saveOptions.EmbedFullFonts = true;
doc.Save(fileName + ".pdf", saveOptions);

But nothing will happen.

Can any on help me to solve this issue?

Thanks,
Pandian

Hi Pandian,

Thanks for your inquiry. Could you please attach your input Word document along with barcode font here for testing? I will investigate the issue on my side and provide you more information.

Hi,


Here i have attached the font, Word document & output PDF file. Please find that

Also, I have listed the steps to reproduce the issue.

  • Create a word Document and type any thing in that. Then change that letters to the font i have attached.
  • Then Save the word file with any name like “Sample.docx” in your Directory. (ex: “C:\Sample.docx”)
  • Then try the below code
var wordBytes = File.ReadAllBytes(@“C:\Sample.docx”);
File.WriteAllBytes(@“C:\Input.docx”, wordBytes);
var doc = new Aspose.Words.Document(@“C:\Input.docx”);
doc.Save(“Output.pdf”);

Now you can see there is no Barcode in the output pdf.

Thanks,
Pandian


Hi Pandian,

Thanks for sharing the detail. Perhaps, you are using an older version of Aspose.Words; as with Aspose.Words v14.6.0, I am unable to reproduce this problem on my side. Steps to test this issue.

1) Open input document in MS Word and change the font of text to IDAutomationC128L.
2) Use following code example to convert Word document Pdf.


Document
doc = new Document(MyDir

  • “Input-SampleDocument.docx”);

doc.Save(MyDir + "Out.pdf");

<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:DoNotShowPropertyChanges/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>AR-SA</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><!–[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

<![endif]–>
I would suggest you please upgrade to the latest version of Aspose.Words i.e. v14.6.0
and let us know how it goes on your side. I hope, this will help. I
have attached the input/output documents with this post for your kind reference.