Telerik Forums
Telerik Document Processing Forum
1 answer
310 views

Hi,

 

I create several documents using word processing and finally merge them into a single one using RadFlowDocument.Merge method. When you open that document in Word and insert a header, the header will only be set for single merged documents and not consistently across the whole document.

To repro:

- Create 2 RadFlowDocuments, with a single page and some simple demo text

- Merge them into a single one

- Export the merged document as docx.

- Open the exported document in word and add some text to the header on page 1.

- Scroll down to page 2 and confirm that the header is not there.

 

I can't tell whether this is a bug or a feature, but is there a way to workaround this? Ultimately I just want to merge several documents into one and have consistent headers and footers across the whole document.

Thanks in advance

Florian

Tanya
Telerik team
 answered on 16 Feb 2016
1 answer
211 views
I am using the RadSpreadsheet component and I am filling it with data from code behind. I would like to resize only the 'used' columns to a width that fits the content from each column. Something like the AutoFitWidth(). 

I tried to use this method (AutoFitWidth()) in a ColumnSelection, however I could only use in all columns, not just the ones I used and I took more than 2 minutes to open my window... I don't want this... As I fill my spreadsheet from code behind, I don't know how many columns I am using... It depends on the settings the user chose before the window opens...

Is there any solution for this?
Deyan
Telerik team
 answered on 15 Feb 2016
1 answer
669 views

Hi,

 I try to do the following: 

1. Load .docx document into the RichTextBox

2. Let the user edit the document

3. Perform MailMerge on the document

4. Export the result as PDF witha compliance level PdfComplianceLevel.PdfA1B

 

Only the WordsProcessing library supports the compliance level, so I need to convert the RadDocument to a RadFlowDocument.

When I export the RadDocument from the RichTexBox back to .docx I somehow loose all the styles (See WordBefore.png, WordAfter.png).

When I export the RadDocument to .rtf, it keeps the correct styles, but when I import it using the Telerik.Windows.Documents.Flow.FormatProviders.Rtf.RtfFormatProvider, I get the following Exception:

Message: The document element is already associated with a parent.
Parametername: item
 
StackTrace:   bei Telerik.Windows.Documents.Flow.Model.Collections.DocumentElementCollection`2.VerifyDocumentElementOnInsert(T item)
   bei Telerik.Windows.Documents.Core.Data.DocumentElementCollectionBase`2.Add(T item)
   bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.Import.RtfImportContext.AddInline(InlineBase inline)
   bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.Import.TagHandlers.GroupTagHandlers.BookmarkEndHandler(RtfGroup group, RtfImportContext context)
   bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.Import.RtfDocumentImporter.DoVisitGroup(RtfGroup group)
   bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.Import.RtfElementIteratorBase.VisitElement(RtfElement element, Boolean recursive)
   bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.Import.RtfElementIteratorBase.VisitGroupChildren(RtfGroup group, Boolean recursive)
   bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.Import.RtfDocumentImporter.ImportRoot(RtfGroup rtfGroup)
   bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.Import.RtfDocumentImporter.Import(Stream input)
   bei Telerik.Windows.Documents.Flow.FormatProviders.Rtf.RtfFormatProvider.ImportOverride(Stream input)
   bei Telerik.Windows.Documents.Common.FormatProviders.FormatProviderBase`1.Import(Stream input)
...

 Do you have any proposal for me how I can accomplish this?

Todor
Telerik team
 answered on 09 Feb 2016
2 answers
121 views

Hello,

I am trying to:

1 - Open a PDF created from Gridview's ExportToPdf function

2 - Draw a title on the page

3 - Save the PDF

When I run my code everything executes, but the final PDF is a blank page, but with the same length as the original PDF.

If I only open the page and then immediately save the PDF without attempting to draw on the page, the result is the same.

First, can PDFProcessing do this? I've heard that not all of your various PDF exports are compatible with all of the imports yet.

 If that is the case, do you have an alternate way for me to get some title text on the PDF file generated by GridView's ExportToPdf function?

 Thanks in advance,

 Scott

Scott
Top achievements
Rank 1
 answered on 03 Feb 2016
1 answer
776 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
198 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
446 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
149 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
916 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
135 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?