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

Free Support Forum - aspose.com

PDF from ASPOSE in multiple languages

We have HTML text in following languages, do you know that Aspose.pdf product supports different languages.

List of languages are :

German
Dutch
Spanish
Korean
Japanese
Traditional Chinese
Simple Chinese
Spanish
Portugese

Hi Pankaj,

Thanks for contacting support.

Aspose.Pdf for .NET supports multiple languages while creating PDF document. Please try using following code snippet to convert HTML files to PDF format and in case you encounter any issue, please share the resource HTML so that we can test the scenario at our end.

[C#]

// load input HTML

Document pdfDocument = new Document("c:/pdftest/sample.html", new HtmlLoadOptions());

// save output in PDF format

pdfDocument.Save(“c:/pdftest/Multi-Language.pdf”);<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<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>X-NONE</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:8.0pt; mso-para-margin-left:0in; line-height:107%; 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; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}

<![endif]–>

Besides this, you may also consider reading HTML contents inside String object, add HTML string to PDF file and while adding HTML to PDF. For further details, please visit Add HTML String using DOM

Thanks for the reply. Please let me know if your aspose.pdf product can support the mentioned languages.

Hi Pankaj,


As shared earlier, Aspose.Pdf for .NET supports multiple languages while creating PDF document. Please take a look over following code snippet. For your reference, I have also attached the resultant PDF generated over my end.

[VB.NET]

Dim textdoc As Document = New Document()<o:p></o:p>

Dim page As Page = textdoc.Pages.Add()

'Chinese

Dim textc As Aspose.Pdf.HtmlFragment = New Aspose.Pdf.HtmlFragment(" The Chinese Text Project (CTP; Chinese: 中國哲學書電子化計劃) is a digital library project")

'German text

Dim textg As Aspose.Pdf.Text.TextFragment = New Aspose.Pdf.Text.TextFragment("Es war ein super-schwüller Tag. Wir konnten die Hitze kaum ertragen und entschlossen ")

'Set text properties

textg.TextState.FontSize = 8

textg.TextState.Font = Aspose.Pdf.Text.FontRepository.FindFont("Arial Unicode MS")

'Japanese text

Dim textj As Aspose.Pdf.HtmlFragment = New Aspose.Pdf.HtmlFragment(" ラドクリフ、マラソン五輪代表 1m出場にも")

'Set text properties

'Add a new text paragraph in paragraphs collection and pass the TextFramment object

page.Paragraphs.Add(textc)

page.Paragraphs.Add(textj)

page.Paragraphs.Add(textg)

'Save resultant PDF file

textdoc.Save("c:/pdftest/Multi-Language_TextPDF.pdf")