Getting a exception error 4004 when displaying a xod file with DocumentViewer

70 views
Skip to first unread message

Gilles B

unread,
Jun 27, 2013, 3:56:02 AM6/27/13
to silv...@googlegroups.com
I'm usind SilverDox for Silverlight 5.
I just modify a little bit your "StreamingSample"

            ...
            / note that user input should be filtered for security reasons
            string filePath = Server.MapPath(".") + "/ClientBin/" + Request["file"];
           
            // Test: small modification to compute the xod file from a word sample file using pdftron.PDF (from WebViewerConvert sample);
            pdftron.PDFNet.Initialize();
            pdftron.PDF.Convert.XODOutputOptions options = new pdftron.PDF.Convert.XODOutputOptions();
            options.SetOutputThumbnails(false);
            pdftron.PDF.Convert.ToXod(Server.MapPath(".") + "/ClientBin/newsletter.pdf", filePath,options);
            pdftron.PDFNet.Terminate();
            // end of modification

            // Opens a stream from a  .xod file on server.
            // Using PDFNet, an original file (e.g. a pdf file) could be converted on the fly and
            // streamed directly to the client. See the PDFNet sample "SilverDoxStreaming".
            using (FileStream fs = new FileStream(filePath, FileMode.Open))
            {
                ...
               
a "newsletter.xod" file is correctly generated (but bigger than your sample )
but i have an exception in the silverlight viewer < DocumentViewer : PDFTron.SilverDox.Controls> when the file is displayed or then i move to next/previous pages

An unhandled exception ('Unhandled Error in Silvelight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.FormatException : le format de la chaîne d'entrée est incorrect  (Input string had an incorrect format)


Do you have an idea ?

ac...@pdftron.com

unread,
Jun 27, 2013, 2:38:56 PM6/27/13
to silv...@googlegroups.com
Hi Gilles,

We have recently released version 6 of PDFNet and have also updated the Silverdox viewer to support XFDF annotations. Can you please try using the latest version of PDFNet with the latest Silverdox?


Best Regards,
Alan

Gilles B

unread,
Jun 28, 2013, 6:17:57 AM6/28/13
to silv...@googlegroups.com
Hi,

I'm using the Version 6.0.0.0

I have investigate, and i found the problem, your solution (specialy the new annotations management )seems to be incompatible with the French decimal separator ( ','/comma)


stackTrace
   à System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt)
   à System.Double.Parse(String s)
   à 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.Controls.DocumentViewer.


I found the 2 next workarounds :
- change the decimal separator from , (French) to . (English) in the client computer (not acceptable)
- or better, remove annotation from the XOD file (during the time you correct this)
options.SetAnnotationOutput(pdftron.PDF.Convert.XODOutputOptions.AnnotationOutputFlag.e_external_xfdf);

thanks
Reply all
Reply to author
Forward
0 new messages