Telerik Forums
Telerik Document Processing Forum
1 answer
842 views

I really like the Telerik DPL and I'm using RadFlowDocument with PdfFormatProvider to produce some much need PDFs, but I've got 2 major issues:

 

1). The tables (Table table = section.Blocks.AddTable();) don't seem to support any sort of Table Headers, I want it to simply repeat the table headers when it flows onto another page. Much like itextsharp's setHeaderRows(). Is this possible?

 

2) There doesn't seem to be any support for pages numbers in the footer?

 

Thanks,

Boby
Telerik team
 answered on 22 Jan 2016
2 answers
235 views

Hi there!

 So I'm using  kendo.drawing.drawDOM() to Export a <div> area on page to a PDF, this works great in my versions of Firefox and Chrome. However in IE 11, its not grabbing the backgrounds of a few divs in the area. This chart area is created problematically, and the "water bottle" columns are being shown based on a height that is calculated by the values...anyway. 

While testing, I determined it was most likely the  background-image that isn't getting pulled correctly. I added a new div with the same class and that one too, failed to be copied into the PDF. I tried swapping out the div with an <img> tag, and while that worked for the pdf export...I lost a bunch of the flexibility of having the image in a div. The image came out streched and generally not what I wanted.

Any ideas for what I can do to make this work in IE?

The html for each column looks something like this:

<div class="WaterBottleColumn" style="background-image: url(../../Content/Images/waterBottlesSmall.png);height: 32px;" title="8,473 water bottle equivalents"></div>

The CSS:

 div.WaterBottleColumn {
    background-repeat: no-repeat;
    background-position: center top;
    margin-left: auto;
    margin-right: auto;
}

 I did have the background-image declared in the CSS class, but I moved it when I was troubleshooting. 

 

Thanks!

Jeff
Top achievements
Rank 1
 answered on 18 Jan 2016
2 answers
492 views

Hello

Will some day PDFProcessing support theader/tfoot tags?

Another thing, an error occurs when you try to convert this html: https://goo.gl/PgMWsB

Thanks

Maurício
Top achievements
Rank 1
 answered on 18 Jan 2016
4 answers
184 views
Hi,

I red all documentation and all forum's threads and didn't find a complete workable example that compress/decompress a stream . Every founded examples did not work well. Is it possible to have a complete example closer to a cut and paste?

Regards,

I put my code here. It compresses but the decompression is not functionnal:
Public Class Class1
  
    Dim msCompress As Stream
  
    Public Function Compression(arg As String) As String
        Dim encoding As New System.Text.UTF8Encoding()
        Dim B() As Byte = encoding.GetBytes(arg)
        msCompress = New MemoryStream()
  
        Dim method As ZipCompression = DirectCast([Enum].Parse(GetType(ZipCompression), ZipCompression.Deflate64, False), ZipCompression)
        Dim zipOut As New ZipOutputStream(msCompress, method)
        Dim sWriter As New StreamWriter(zipOut)
  
        sWriter.Write(B)
        sWriter.Flush()
  
        Return ("Compress: " & zipOut.CompressedSize.ToString & ", Uncompress:" & zipOut.UncompressedSize.ToString)
  
    End Function
  
    Public Function Decompression(arg As String) As String
        Dim encoding As New System.Text.UTF8Encoding()
        msCompress.Position = 0
        Dim inputStream As New ZipInputStream(msCompress, False)
        Dim s As String
        Dim Reader As New StreamReader(inputStream.BaseStream, encoding)
        s = Reader.ReadToEnd()
  
        Return s
    End Function
End Class
Nikolay Demirev
Telerik team
 answered on 15 Jan 2016
1 answer
968 views

Hi,

I am working on a project to programmatically create reports using RadFlowDocument. I could not find a way to add page number to footer of the document.

I came across this link: http://www.telerik.com/forums/adding-page-number-in-the-footer. But it shows how to add page number from the RadRichTextBox using RadDocument.

I would appreciate if you can help me with this.

Thanks,

Sujan

Tanya
Telerik team
 answered on 04 Jan 2016
1 answer
163 views

Hi,
I've a simple target.
1) Import the template from a docx file 
2) Replace part of document with HTML
3) Save the document in docx (or pdf) format

I don't know if this is possible with Telerik components.

 

Thanks,
Marco

 

Boby
Telerik team
 answered on 23 Dec 2015
1 answer
435 views

First I create the table by editor like this

RadFlowDocument tableDoc = new RadFlowDocument();
RadFlowDocumentEditor editor = new RadFlowDocumentEditor(tableDoc);
Telerik.Windows.Documents.Flow.Model.Table newTable = editor.InsertTable(1, 2);

     newTable.Rows[0].Cells[0].Borders = new TableCellBorders(
               new Telerik.Windows.Documents.Flow.Model.Styles.Border(1, Telerik.Windows.Documents.Flow.Model.Styles.BorderStyle.Single, ThemableColor.FromArgb(100, 0, 100, 0)),
               new Telerik.Windows.Documents.Flow.Model.Styles.Border(1, Telerik.Windows.Documents.Flow.Model.Styles.BorderStyle.None, ThemableColor.FromArgb(100, 0, 100, 0)),
               new Telerik.Windows.Documents.Flow.Model.Styles.Border(1, Telerik.Windows.Documents.Flow.Model.Styles.BorderStyle.Single, ThemableColor.FromArgb(100, 0, 100, 0)),
               new Telerik.Windows.Documents.Flow.Model.Styles.Border(1, Telerik.Windows.Documents.Flow.Model.Styles.BorderStyle.Single, ThemableColor.FromArgb(100, 0, 100, 0)));

 and prepare  the html string (with convert function) like this

string html = "<p>HTML STR   1234<span style=\"line-height:20px;\">1234   1234  </span></p>";
           HtmlFormatProvider providerHtml = new HtmlFormatProvider();
           RadFlowDocument document = providerHtml.Import(html); 

but I don't know how to put " RadFlowDocument " into table I 'm already try this but it show some error "The document element is associated with another document.
Parameter name: item"  . Please Help!!

Paragraph paragraph = new Paragraph(document);
 newTable.Rows[0].Cells[0].Blocks.Insert(0, paragraph);


 

 

 

 

 

 

Todor
Telerik team
 answered on 23 Dec 2015
1 answer
444 views

I use there code to make a docx file

 

RadFlowDocument document = new RadFlowDocument();
RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);
editor = new RadFlowDocumentEditor(document);
 
editor.insertText("this is page 1 ");
 
// but the problem is I want to insert text in another A4 page like
 
editor.insertText("this is page 2 ");

According to the document telerik I found that we can set up "section" for A4 page 

http://docs.telerik.com/devtools/aspnet-ajax/controls/wordsprocessing/model/section#rotating-a-section

but I think I don't understand how to use it please help !!
Section section = new Telerik.Windows.Documents.Flow.Model.Section(document);
         document.Sections.Add(section);
 
         section.PageMargins = new Telerik.Windows.Documents.Primitives.Padding(40, 10, 40, 10);
         section.PageSize = PaperTypeConverter.ToSize(PaperTypes.A4);//WindowsBase assembly should be referenced.
          
         editor.InsertSection();
         editor.InsertText(("Page 2 !!"));

 

and is it possible that we know what is the current page number before "insertText" ?

Tanya
Telerik team
 answered on 23 Dec 2015
1 answer
1.0K+ views

Hello

     I have a form in a windows application. The form contains grids, table, images, other data and a link called PDF generate. What is the best way to generate a pdf with the same format on the form with all the data using telerik controls?

 

David
Top achievements
Rank 1
 answered on 21 Dec 2015
1 answer
243 views

Hi all,

I've an Excel template with table objects (Ribbon Insert/Table). Is it possible with SpreadProcessing to get this object (by name) and fill it with data? Thanks a lot for your help.

Kind regards
Christian

 

Tanya
Telerik team
 answered on 03 Dec 2015
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?