This is a migrated thread and some comments may be shown as answers.

I need to store text documents

7 Answers 49 Views
Book
This is a migrated thread and some comments may be shown as answers.
Compactis
Top achievements
Rank 1
Compactis asked on 23 Jun 2011, 08:25 PM

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

Sort by
0
Alex
Telerik team
answered on 29 Jun 2011, 01:09 PM
Hi DutchSoft,

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.
I hope this was helpful. Please write us again if you need further assistance.

Greetings,
Alex
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Compactis
Top achievements
Rank 1
answered on 04 Jul 2011, 05:51 PM
Thank you for your reply.
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
0
Iva Toteva
Telerik team
answered on 08 Jul 2011, 01:12 PM
Hi Dutchsoft,

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.

Greetings,
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!

0
Compactis
Top achievements
Rank 1
answered on 20 Jul 2011, 10:37 PM
Thank you very much. This solves my problem and deepens my Rad component knowledges.
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
0
Iva Toteva
Telerik team
answered on 26 Jul 2011, 05:16 PM
Hi 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.

Best wishes,
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!

0
Petr Juna
Top achievements
Rank 1
answered on 27 Jul 2011, 10:38 AM
Thank you very much.
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.
0
Kiril Stanoev
Telerik team
answered on 01 Aug 2011, 10:58 AM
Hello Petr,

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 >>

Tags
Book
Asked by
Compactis
Top achievements
Rank 1
Answers by
Alex
Telerik team
Compactis
Top achievements
Rank 1
Iva Toteva
Telerik team
Petr Juna
Top achievements
Rank 1
Kiril Stanoev
Telerik team
Share this question
or