Highlight in Universal Viewer HTML5 and SilverLight

96 views
Skip to first unread message

Richard Dupont

unread,
Aug 15, 2014, 1:52:19 PM8/15/14
to pdfnet-w...@googlegroups.com
Hello,

I'm switching back and fort from the HTML5 and SilverLight viewer. And I have a problem with the Highlight tool.

When I do the annotation from the silverlight viewer and save it I can see it in both the Html5 and Silverlight viewer. But when I save it from the Html5 viewer it's only work in the Html5 viewer and in the Silverlight one all the annotation become invisible.

The XFDF generated from each viewer are differents.

For example I highlighted some text in SilverLight, saved it. Load the doc in the Html5 viewer and save it back. Here is the content of the 2 XFDF file.

SilverLight :

<?xml version='1.0' encoding='UTF-8'?>
<xfdf xml:space="preserve" xmlns="http://ns.adobe.com/xfdf/">
<annots>
<highlight color="#FFFF00" coords="123.045031,506.400127,316.897579,506.400127,123.045031,498.225125,316.897579,498.225125,122.865031,493.800123,291.862573,493.800123,122.865031,483.442621,291.862573,483.442621" selectstart="164.077682,384.466064" selectend="392.718475,404.854401" subject="TextHighlight" page="0" title="Richard Dupont (FMET94)" creationdate="D:20140815134354-04'00'" date="D:20140815134356-04'00'" rect="122.865031,483.442621,316.897579,506.400127" flags="print">
<popup flags="print,nozoom,norotate" open="no" page="0" rect="0,679.50017,112.500028,792.000198" />
</highlight>
</annots>
<pages>
<defmtx matrix="1.333333,0,0,-1.333333,0,1056" />
</pages>
</xfdf>

HTML5 :

<?xml version="1.0" encoding="UTF-8" ?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
<fields />
<annots><highlight subject="TextHighlight" page="0" rect="122.865031,506.400127,316.897579,483.442621" name="7575e238-a2dc-7226-745d-033b06ceb937" title="Richard Dupont (FMET94)" date="D:20140815134402-04'00'" color="#FFFF00" interior-color="#000000" opacity="0.25" creationdate="D:20140815134354-04'00'" coords="123.045031,506.400127,316.897579,506.400127,123.045031,498.225125,316.897579,498.225125,122.865031,493.800123,291.862573,493.800123,122.865031,483.442621,291.862573,483.442621"><popup flags="print,nozoom,norotate" page="0" rect="0,792.000198,112.500028,679.50017" open="no"/></highlight></annots>
<pages>
<defmtx matrix="1.333333,0,0,-1.333333,0,1056" />
</pages>
</xfdf>

Matt Parizeau

unread,
Aug 18, 2014, 3:41:25 PM8/18/14
to pdfnet-w...@googlegroups.com
Hi Richard,

You may want to try the latest version of WebViewer (1.8). Here are the steps I took to try to reproduce the problem:
1. Found the webviewer-controls sample, specifically webviewer-controls.html
2. Found the PDFTron.WebViewer constructor in webviewer-controls.html and added the option serverUrl: '../../lib/html5/annotationHandler.php'
3. Created a highlight annotation in Silverlight and saved it.
4. Opened the HTML5 viewer and the annotation was visible.
5. Added another highlight from the HTML5 viewer and saved it.
6. Switched back to the Silverlight viewer and both annotations were visible.

Matt Parizeau
Software Developer
PDFTron Systems Inc.

Richard Dupont

unread,
Sep 22, 2014, 4:43:51 PM9/22/14
to pdfnet-w...@googlegroups.com
Hi Matt,

I update to the new version of the WebViewer. It in a way corrected my error but I now have a problem with the decimal separator in the SilverLight viewer. It only work when in the regional settings it's set to the english ".". But here we are in french and it the "," that we are using.

Does the version of the pdfnet library have anything to do with it? I'm currently using the 6.2.1.23937 one.

When it set to the french one I get this error message:

Détails de l’erreur de la page Web

Agent utilisateur : Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; InfoPath.1; .NET CLR 1.1.4322; .NET4.0E)
Horodateur : Mon, 22 Sep 2014 20:42:20 UTC


Message : Unhandled Error in Silverlight Application Le format de la chaîne d'entrée est incorrect.   à System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
   à PDFTron.SilverDox.Documents.Annotations.XfdfManager.LoadXfdfPages(Stream xfdfPages, Document doc)
   à PDFTron.SilverDox.Documents.Annotations.AnnotationManager.LoadXfdfPages(Stream xfdfPages)
   à PDFTron.SilverDox.Controls.DocumentViewer.LoadInternalXfdfAnnotations(Int32 pageNumber)
   à PDFTron.SilverDox.Samples.ReaderControl.downloader_OpenReadCompleted(Object sender, OpenReadCompletedEventArgs e)
   à System.Net.WebClient.OnOpenReadCompleted(OpenReadCompletedEventArgs e)
   à System.Net.WebClient.OpenReadOperationCompleted(Object arg)
Ligne : 1
Caractère : 1
Code : 0

Matt Parizeau

unread,
Sep 23, 2014, 6:01:23 PM9/23/14
to pdfnet-w...@googlegroups.com
Hi Richard,

Can you try updating your ReaderControl.xap file in lib/silverlight to the one I've attached here as that should fix the issue.

Matt Parizeau
Software Developer
PDFTron Systems Inc.
ReaderControl.xap

Richard Dupont

unread,
Sep 24, 2014, 8:20:57 AM9/24/14
to pdfnet-w...@googlegroups.com
Thank you Matt.

Everything is working now!!!
Reply all
Reply to author
Forward
0 new messages