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

Free Support Forum - aspose.com

Word to PDF conversion "double encodes" hyperlinks

Hi,

We are using Aspose.Words for .NET (version 16.12.0) to convert Word documents to PDF. Normally, this works fine; however, we have recently run into an issue with Word documents that contain hyperlinks that are already percent encoded. For example, the Word document contains a hyperlink in the form of:

<span style=“font-size:12.0pt;mso-bidi-font-size:11.0pt;
font-family:“Calibri”,“sans-serif”;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:“Times New Roman”;mso-bidi-theme-font:minor-bidi;
mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>http://mywebsite.com/sites/Shared%20Documents/myitems

When the document is converted to a PDF using Aspose.Words, the link is now:

<span style=“font-size:12.0pt;mso-bidi-font-size:11.0pt;
font-family:“Calibri”,“sans-serif”;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:
Calibri;mso-fareast-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:“Times New Roman”;mso-bidi-theme-font:minor-bidi;
mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>http://mywebsite.com/sites/Shared%2520Documents/myitems

It appears that Aspose.Words is “re-encoding” the percent sign for the “%20” encoding, which means that this now becomes “%2520” (because “%25” is the percent encoding for the percent sign itself). This makes the link invalid and is frustrating our users.

If we save the PDF directly from Microsoft Word, this double-encoding with percent signs does NOT happen. Is this a bug in Aspose.Words or something that will be fixed?

Thanks,
Natalie<!–[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: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]–>

Hi Arturo,


Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:


  • Please share your input document file.
  • Aspose.Words generated output file showing the undesired behavior.


As soon as you get these pieces of information ready, we'll start further investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip them and Click 'Reply' button that will bring you to the 'reply page' and there at the bottom you can include any attachments with that post by clicking the 'Add/Update' button.

Thanks for the quick response.

I’m attaching a Word file and an Aspose-generated PDF file that demonstrates the issue. If you hover over the link in the PDF file (which will show you the URL that will be navigated to if you click the link), you will notice that there is an extra “%25” in the link and this is what is causing the issues.

Thanks,
Natalie

Hi Arturo,

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issue at our side. We have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-14728. Your request has also been linked to the appropriate issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Thank you! That is much appreciated. I’ll keep checking back for updates.

–Natalie

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)