Hello,
I would need your help with following problem:
Assignment:
1 – I need to store text documents (docx or rtf) and image files in the database - it's OK.
2 - then I need to display these data in the form RadBook in Silverlight on the Web.
When I use for displaying a docx document, so it is good, but the file is too large (10 to 20 MB- ...) and then I need to extend this document (add new pages) with the fact that it is not possible change the existing content.
The second option is to store the pages separately as ??? (rtf, docx), and then stretching it while turning pages in RadBook.
I ask you to help to solve this. How to use specific components to use(write) one of above mentioned variants. Preferably the second one ( to read each page through WS).
How shall I write this view in the code (XAML) with the option to enlarge this page in a new window?
Thank you very much.
Regards
7 Answers, 1 is accepted
Looks like you can use RadDocument in your scenario. Here is what you can do:
- Create RadDocuemnt from you docx or rtf document using FormatProviders. You can read more on how to use format providers in this article.
- Show the imported document in RadBook using the DocumentViewManager and RadRichTextPageView classes. You can take a look in this example which does exactly the same. Note that when shown in RadBook, the document will be read-only, so the users will not be able to change its content directly.
- You can still alter the document from code using the RadDocument API. This way you will be able to add/remove pages if you need to.
Alex
the Telerik team
One more issue: One page will be docx, the second also, but the third page could be a scanned image (jpeg). How to use this. Could you please write me an example of code (I am a beginner in Silverlight) of removing and adding pages?
Thank you
RadDocument makes what is needed to layout its content among the pages. All you need to do is insert the new content in the current document - be it text or image.
Unfortunately, parts of the document cannot be deleted unless a code-behind RadRichTextBox is instantiated and the methods from its API are used.
Please find attached a sample demo illustrating how this can be done.
I hope this helps.
Iva
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
Just another issue: I would need to create an offline book from this way generated book. I thought it could be generated through HTML.
It means: to download all the necessary pages and to create of them pictures. But I have a problem with creating of pictures from XAML. Is there any elegant solution? Or even from DOCX?
Thank you very much.
Petr Jůna
DutchSoft
Generating pictures from the document is not a feature supported out-of-the-box.
What you can do is to use RadRichTextPageView and WriteableBitmap to generate the images. RadRichTextPageView is needed, so that you can get the separate pages of the document and take "screenshots" of them with WriteableBitmap.
Please find attached a sample demo illustrating the approach. You can just run it and see the resulting images, which will get added to the main page.
Iva
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!
One more question. How do I view only one page from an already loaded RadBook control. Do I need to zoom the page. Or another way to zoom.
Thank you
Dutchsoft
Sorry for the translation, Google translates it to me.
For your particular scenario you can use the Silverlight's Transforms. More information can be found here.
Regards,
Kiril Stanoev
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>