Hi,
We’re working on a viewer that can display documents on a web page and allow a user to view/scroll through them. We have this working by converting the documents to jpegs, and are looking to change the output format to SVG so that users can select/copy text and follow links, etc. I’ve encountered a couple of issues I was wondering if you could help with.
In IE-11 my test documents render just fine, but oddly, when selecting text, IE will only allow a single word at a time to be selected. I’ve tried a couple of self-created SVG samples w/text tags and selection works as expected, however with any doc created from aspose, I can only select one word at a time out of any passage of text. BTW, I’m appending the SVG output to a
, added a viewBox attribute for scaling, and have height and width set to 100%. Other than that, I’m not modifying the output of the document converter.
One other issue is that links in documents don’t work in Chrome and Firefox (but do work in IE), I’m by no means an expert in SVG, but I did notice that all link samples I can find for SVG prepend the “xlink” namespace to the href attribute of the tag. (i.e. xlink:href="…"). In the output SVG from the document converter, the a tags look like standard HTML tags (i.e. …) I’m suspecting that may be the issue w/Chrome/Firefox but I may be wrong about that. Any ideas?
thanks,
John Pompeii
Hyland Software
Hi John,
Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:
- Your input Word document
- Please attach the output Svg file that shows the undesired behavior.
- Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.
As soon as you get these pieces of information ready, we’ll start 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.
OK, I have created a sample to illustrate the two problems. The word doc and the svg output are in the attached zip file. There is also an html file that illustrates the issues. What I did is take the generated svg content and embed it within a
in the web page. For this issue, a console app does not make sense.
If you load the html file into Chrome or FF, text selection works but the link does not. If you load the file into IE-11, only one word at a time can be selected and the link works fine.
The one other thing about this svg output also is that it draws a line around the document. Can that be turned off?
thanks,
–john
OH, I forgot to mention. If I qualify the href attribute in the svg tag with “xlink:”, it works fine in Chrome and FF
Hi John,
Thanks for sharing the detail. We have tested the scenario and have managed to reproduce the same issues at our side. For the sake of correction, we have logged these problems in our issue tracking system as follow:
WORDSNET-13373 : Docx to SVG conversion issue with text selection in IE-11
WORDSNET-13375 : Docx to SVG conversion issue with hyperlink in Chrome and Firefox
You will be notified via this forum thread once these issues are resolved. We apologize for your inconvenience.
jpompeii:
The one other thing about this svg output also is that it draws a line around the document. Can that be turned off?
Please use SvgSaveOptions.ShowPageBorder property to control whether a border is added to the outline of the page. Please check following code example for your kind reference.
Document doc = new Document(MyDir + "Simple.docx");
SvgSaveOptions options = new SvgSaveOptions();
options.ShowPageBorder = false;
doc.Save(MyDir + "Out.svg", options);
Hi John,
Thank you for using Aspose.Words. I fixed the problem with text selection in IE. The fix will be included into May release of Aspose.Words. But the issue is fixed only partially because of SVG text selection restrictions. Please see “Text selection implementation notes” in SVG specification:
https://www.w3.org/TR/SVG/implnote.html
The problem is that by specification text is supposed to be selected within ‘text’ element, but if text is represented by multiple ‘text’ elements you cannot select them all. The fix I implemented replaces neighbor text elements with ‘tspan’ elements and put them into a single ‘text’ element. This significantly improves text selection in IE, but it is still impossible to select whole text. I am afraid we can do nothing here, since this is SVG text selection implementation specific in IE.
Best regards,
The issues you have found earlier (filed as WORDSNET-13375) have been fixed in this .NET update and this Java update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.
The issues you have found earlier (filed as WORDSNET-13373) have been fixed in this .NET update and this Java update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.