Telerik Forums
Telerik Document Processing Forum
3 answers
985 views
You've officially made things confusing by having the different libraries for the spreadsheet.  I need a good (current) example on how to do an easy import and export of a Spreadsheet that I am using/showing in a Spreadsheet Control.  Also, I'll be saving the spreadsheet to a SQL table so do you have an example where I don't have to write out to a FileStream first?  I'd like to go directly from a Stream to a byte array without writing to the file system.
Nikolay Demirev
Telerik team
 answered on 13 Sep 2016
6 answers
545 views

I'm sure this is possible but I cant quite get the provider usage figured out. I have a string  of HTML I want to output as a PDF . This does not work, what am i doing wrong?

    protected void test(string htmlString)

    {
        HtmlFormatProvider htmlDoc = new HtmlFormatProvider();
        htmlDoc.Import(htmlString);
        byte[] renderedBytes = null;

        IFormatProvider<RadFlowDocument> formatProvider = new PdfFormatProvider();
        using (MemoryStream ms = new MemoryStream())
        {
            formatProvider.Export(htmlDoc, ms); // this is invalid
            renderedBytes = ms.ToArray();
        }
        Response.Clear();
        Response.AppendHeader("Content-Disposition", "attachment; filename=ExportedFile" + ".pdf");
        Response.ContentType = "application/pdf";
        Response.BinaryWrite(renderedBytes);
        Response.End();

Nikolay Demirev
Telerik team
 answered on 13 Sep 2016
8 answers
496 views
Is it possible to run the XlsxFormatProvider in an Async to report the progress on a RadProgressBar?
Carlitos
Top achievements
Rank 1
 answered on 06 Sep 2016
2 answers
975 views

I need help setting document margins when convert html to word using the following technique.

string html = "<p>hello world!</p>";
HtmlFormatProvider provider = new HtmlFormatProvider();
RadFlowDocument document = provider.Import(html);

I tried using the following with no luck

PageMargins = new Telerik.Windows.Documents.Primitives.Padding(30, 0, 0, 5);

Are there any examples showing what I require?

Thank you

Andy

Andrew
Top achievements
Rank 1
 answered on 25 Aug 2016
1 answer
390 views

I need help setting document margins when convert html to word using the following technique.

string html = "<p>hello world!</p>";
HtmlFormatProvider provider = new HtmlFormatProvider();
RadFlowDocument document = provider.Import(html);

I tried using the following with no luck

PageMargins = new Telerik.Windows.Documents.Primitives.Padding(30, 0, 0, 5);

Are there any examples showing what I require?

Thank you

Andy

Tanya
Telerik team
 answered on 24 Aug 2016
3 answers
955 views

Hi,

i have 2 RadFixedDouments and i want to merge them in one RadFixedDocument.

Merge method works ok but i add new page for each of document.

My goal is to create one document which looks like this:

1. Content from *NameOfFirstDocument*:

-- here content --

2. Content from *NameOfSecondDocument*:

-- here content --

 

I almost done this:

- created RadFixedDocument (call it Main),

- used RadFixedDocumentEditor.InsertBlock( block with "1. Content from *NameOfFirstDocument*:" ) on Main document,

- set FixedContentEditor proper position (under block),

- foreach Content element in one and only Page in FirstDocument use FixedContentEditor.Draw to add content (as a TextFragment) on Main document,

- the same things for second document.

The problem is when i'm exporting Main document to pdf, it is cutting content of each document if it is larger than one page.

 

It looks like FixedContentEditor.Draw add lines but it does not take in account page size.

 

Any help with copying content of one RadFixedDocument to other? It's strange i cant use in any of ways a RadFixedDocumentEditor to insert other RadFixedDocument content in next lines.

 

Thanks,

Jacob.

Tanya
Telerik team
 answered on 11 Aug 2016
1 answer
200 views

Hi,

here is my sample console app:

using System.IO;
using Telerik.Windows.Documents.FormatProviders.Pdf;
using Telerik.Windows.Documents.Model;
 
namespace PdfExportTest
{
    class Program
    {
        static void Main(string[] args)
        {
            RadDocument doc = new RadDocument();
            RadDocumentEditor editor = new RadDocumentEditor(doc);
 
            Section section = new Section();
            doc.Sections.Add(section);
 
            editor.Document.CaretPosition.MoveToStartOfDocumentElement(section);
            editor.InsertLine("TEST");
 
            var provider = new PdfFormatProvider();
 
            using (Stream stream = new FileStream(@"C:\\temp\\test.pdf", FileMode.Create))
            {
                provider.Export(doc, stream);
            }
        }
    }
}

When use search option to find "TEST", Adobe Reader shows it couldn't find any matching words.

Is it known issue that Adobe Reader can't find words in exported documents?

Thanks.

Deyan
Telerik team
 answered on 10 Aug 2016
8 answers
175 views

Hi,

I have a simple Word document with JUST a line of text and a DocumentVariable in it, named VAR1. I try to set a value for it in my ASP application, and it works, but when I try to update the field using the UpdateFields() methods, it throws a NullReferenceException. I think it might be a bug in the library, because I tried on several different documents. Can you please help me figure this out? The code it's pretty straightfoward. Maybe it's something wrong with the document?

DocxFormatProvider docxProvider = new DocxFormatProvider();
RadFlowDocument document;
                
using (Stream input = File.OpenRead(docxFilePath))
    document = docxProvider.Import(input)

//document.DocumentVariables.Add("VAR_LINE1", "testline1");
document.DocumentVariables["VAR1"] = "testline1";
try
{
     document.UpdateFields(); // throws exception
} catch (Exception ex) {}

 

Thank you!

Boyko
Telerik team
 answered on 03 Aug 2016
8 answers
699 views

Hi,

I am using the PdfFormatProvider to create pdf files from RadFlowDocument, however the result is not equal to the original layout.

Lines disappear and the table cell padding is wrong.

Please find attached:

Image1: The original file displayed in the RichTextEditor

Image2: The pdf file displayed in the PDF Viewer

Using a standard pdf printer form word renders the word file OK.

 

 

Tanya
Telerik team
 answered on 02 Aug 2016
4 answers
1.5K+ views
I am using PDF processing to generate PDF's for invoicing. I am looking to use tables to hold general information on the other but curious as to what it can handle in terms of sizing capabilities.

My first inquiry is with setting the table to be a specific size, I noticed in documentation that there is a TableLayoutType.FixedWidth; but I couldn't seem to find anything to set the width.

My second inquiry is about the ability to have text in one cell go to a new line and continue. For example if one cell has a very long input of strings or numbers, if it reaches a certain length or the table, it could wrap down to the next cell and continue.

I have been looking through and using the RadPdfProcessing > Editing > Table and haven't seen much to specifically help me with this.

Any suggestions would be appreciated.
Boyko
Telerik team
 answered on 22 Jul 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?