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

Free Support Forum - aspose.com

Converting RTF in 8-bits into PDF

Hi,

I’m using Aspose.Words version 13.7.0.0 to convert different files into PDF for visualization.
However, when trying to convert a RTF file encoded on 8 bits (I guess that will be Extended ASCII), all bytes that are above 127 are cut. For instance, “é” is 130 and is cut to 44, which is “,”.

Preparing the document through an array of bytes, even when explicitly stating the encoding type, doesn’t help :

<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>FR</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:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<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]–>

byte[] inputWordBytes //given through parameters – stored in DB

byte[] pdfBytes;

using (MemoryStream wordBuffer = new MemoryStream(inputWordBytes))

using (MemoryStream pdfBuffer = new MemoryStream())

{

Aspose.Words.LoadOptions loadOpt = new Aspose.Words.LoadOptions();

loadOpt.Encoding = System.Text.Encoding.Default;

Aspose.Words.Document doc = new Aspose.Words.Document(wordBuffer, loadOpt);

Aspose.Words.Saving.PdfSaveOptions pdfSaveOptions = new Aspose.Words.Saving.PdfSaveOptions();

pdfSaveOptions.Compliance = Aspose.Words.Saving.PdfCompliance.PdfA1b;

doc.Save(pdfBuffer, pdfSaveOptions);

pdfBytes = pdfBuffer.ToArray();

}

return pdfBytes;

/* Style Definitions */ table.MsoNormalTable {mso-style-name:"Tableau Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; 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-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; 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]–>
As an attached file is an example of an 8 bit RTF. And yes, it is in “DOC” extension because the other program of our client creates RTF with a “DOC” extension …

Thanks for your help.

Hi there,

Thanks for your inquiry. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSNET-8841 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Thank you for the quick answer !

Do you have any information on the date of next release that will have this issue corrected ?

Hi there,


Thanks for your inquiry. I would like to share with you that issues are addressed and resolved based on first come first serve basis. Currently, your issue is pending for analysis and is in the queue. I am afraid, I cannot provide you any reliable estimate at the moment. Once your issue is analyzed, we will then be able to provide you an estimate.

Thank you for your patience and understanding.

Hello,

Any news concerning this problem ?

Thank you in advance for your response.

Hi there,

Thanks for your inquiry. Your document encoding (UTF-8 for RTF file) is not supported by Aspose.Words at this moment. We have changed the type of WORDSNET-8841 from ‘Bug’ to ‘New Feature’.

I am afraid this feature has now been postponed till a later date due to some other important issues and new features. We will inform you as soon as there are any further developments.

We apologize for your inconvenience.

Do you have any information on the date of next release that will have this issue corrected ?

Hi there,


Thanks

for your inquiry. I regret to share with you that the implementation of
this feature had been postponed. We will inform you as soon as there are
any further developments.

We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-8841) have been fixed in this Aspose.Words for .NET 20.4 update and this Aspose.Words for Java 20.4 update.