Viewing XPS documents in Silverlight

193 views
Skip to first unread message

Support

unread,
Feb 7, 2013, 2:59:04 PM2/7/13
to pdfne...@googlegroups.com
Q: 
 
We are having three problems when rendering some content from an XPS
generated from a PDF with PDFNet SDK inside a silverlight viewer.

Problem 1: (Attachments PDF-1.png, XPS-1.png, 1.fpage) A text in a Glyph
XAML element is rendered with Fill=\"#00000000\". This is then interpreted
as transparent and then the text is not shown. In the PDF and XPS the file
seems to be fine, as it can be seen in PDF-1.png and XPS-1.png. The
generated XAML can be seen in 1.fpage.

Problem 2: (Attachments PDF-2.jpg, XPS-2.png, 1.fpage) Some images inside
XML element ImageBrush are generated as TIFF images, which are not supported
by Silverlight. This implies that those images are not rendered in the
silverlight viewer. In the PDF and XPS the file seems to be fine, as it can
be seen in PDF-2.png and XPS-2.png. The generated XAML can be seen in
1.fpage.

Problem 3: (Attachments PDF-3.png, XPS-3.png, 25.fpage) Some images are
rendered inside a VisualBrush XAML element, which is not supported by
Silverlight. In the PDF and XPS the file seems to be fine, as it can be seen
in PDF-3.png and XPS-3.png. The generated XAML can be seen in 25.fpage.

Please, let me know if these are known issues, and if you are planning to work on them.
 
------
A:
 
What is the Silverlight XPS viewer that you are using on your end?

If you are using SilverDox
(http://www.pdftron.com/silverdox/samplecode.html) then you should convert PDF to XOD (with pdftron.PDF.Convert.ToXod()) - instead to ToXps().  XOD is essentially a web friendly version of XPS.  You can rename XOD to XPS but we prefer to use a different extension so that we know which files are optimized and which not.


If you are using another Silverlight XPS viewer you may want to talk to its developer. The only option we are aware of is firstfloor, however just like SilverDox it does not support full XPS spec. In this case you may be better
off with SilverDox because we can 'guarantee' that all XPS features we produce are rendered accurately.

You should be able to view XOD files in SilverDox or WebViewer (which also supports HTML5 and Flash besides Silverlight - http://www.pdftron.com/pdfnet/webviewer/demo.html) without issues.

You can learn more about WebViewer and SilverDox here:

WebViewer:
http://www.pdftron.com/pdfnet/webviewer/index.html
http://groups.google.com/group/pdfnet-webviewer/topics
http://www.pdftron.com/pdfnet/webviewer/demo/html5/doc/index.html

SilverDox:
http://www.pdftron.com/silverdox/index.html
http://www.pdftron.com/silverdox/documentation/Index.html
http://groups.google.com/group/silverdox/topics



Support

unread,
Feb 7, 2013, 3:02:04 PM2/7/13
to pdfne...@googlegroups.com
Q: 
 
Thanks for your response. We tried the XOD format with success :) . We are using a custom viewer to render the documents (either XPS or XOD).

This avoided TIF (as now they are PNG) and texts HEX code are correctly (we don't have problem 1 anymore).

One remaining question is how does the SilverDox viewer handles VisualBrush as it's an element not supported by Silverlight. Does it skip it?

Besides, we have been detecting some crashes with our custom viewer as well as SilverDox when rendering some Glyphs elements from a well formed XOD as well as XPS. Those crashes happen in agcore.dll, which is a Silverlight 5 DLL in charge of rendering graphics for Silverlight. Have you experienced that in the past?
 
--------
A:
 

You are probably experiencing a bug in Silverlight itself that is triggered by rotated text. We reported the problem to Microsoft some time ago, but until they fix it (which unfortunately seems unlikely) we have implemented a workaround on our side that converts all rotated text to paths. You can enable the workaround by using the --silverlight_text_workaround in the command line tool, or SetSilverlightTextWorkaround(true) (in XODOutputOptions) in the SDK. The text itself will still be selectable and copyable in SilverDox. This option is not on by default because it is not necessary for our HTML5 or Flash viewers (that also open XOD files).

Reply all
Reply to author
Forward
0 new messages