Telerik Forums
Telerik Document Processing Forum
1 answer
128 views
Hi,

I am using table class for generating a grid in PDF. Can i fix the size of each cell in the table. For example suppose we have a 3X3 matrix and each cell can have different data. Can i fix the size of each cell.

Please share code sample if it is possible.

Regards,
Sandeep
Deyan
Telerik team
 answered on 02 Dec 2014
1 answer
304 views
Hi 

How can i add lines in table cell. Suppose i need to cut a triangle in table cell and need to fill different colors in triangle. 

Can you provide some sample code.

Regards,
Sandeep
Deyan
Telerik team
 answered on 02 Dec 2014
1 answer
192 views
In your demo projects, there seems to be a discrepancy between the VB Code and the CSharp Code:

            editor.Position.Translate(defaultLeftIndent * 2, page.Size.Height - 180) 
            Using stream As Stream = GetSampleResourceStream("PdfProcessing.telerik.jpg") 
                editor.DrawImage(stream, ImageFormat.Jpeg) 
            End Using

            editor.Position.Translate(defaultLeftIndent * 2, page.Size.Height - 180); 
            using (Stream stream = GetSampleResourceStream("PdfProcessing.telerik.jpg")) 
            { 
                editor.DrawImage(stream); 
            }

Your VB demo project will not compile.

It would be more friendly, if the DrawImage function had a System.Drawing.Image as argument.

 

/Brian



Dimitar
Telerik team
 answered on 02 Dec 2014
1 answer
499 views
Hi,

I was trying to to add an image in a table cell but not able to do so by using following code.

imageCell.Blocks.AddBlock().InsertImage(stream);

I am missing something here.

Regards,
Sandeep
Tanya
Telerik team
 answered on 01 Dec 2014
1 answer
71 views
I think that PDFProcessing for silverlight is still in it's Beta. What is the actual release date for this.

Regards,
Sandeep
Petya
Telerik team
 answered on 28 Nov 2014
1 answer
267 views
HI,

How i can set Row height and cell width for a Table object. I am using FixedContentEditor.

Regards,
Sandeep
Deyan
Telerik team
 answered on 25 Nov 2014
4 answers
427 views
Hi,
Where can I find the metadata of a PDF file e.g. the Author of a document.
I use the RadFixedDocument class - wrong?

(UI for WinForms, v.2014.1.226.20)

Thanx in advance
Tom

Tom
Top achievements
Rank 1
 answered on 18 Nov 2014
0 answers
116 views
I had a problem with loading & decoding UTF-7 data from a CSV file into Silverlight's RADSpreadProcessing. Special characters like 'é' were being flagged as invalid by the Microsoft UTF-8 decoder in Silverlight. WPF on the other hand supports UTF-7 decoding.

With the help of Nikolay Demirev (Telerik support) he pointed me in the right direction with this Microsoft information: Understanding Encodings for Silverlight

Below is the solution that I came up with to auto-identify the encoding and handle UTF-7 encoded CSV files. I hope that it helps others.

    Sub ProcessData()
 
        Dim FormatProvider = New CsvFormatProvider
 
        With FormatProvider
            With .Settings
                .Delimiter = ","
                .Quote = """"
                .HasHeaderRow = True
                .Encoding = New System.Text.UnicodeEncoding
            End With
        End With
 
        Dim Filename As String = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Telerik Test.csv")
        Dim WB As Workbook = LoadWB(Filename, FormatProvider)
 
        '-- do something with the loaded data...
 
    End Sub
 
    Function LoadWB(FileName As String, FormatProvider As CsvFormatProvider) As Workbook
 
        If Not File.Exists(FileName) Then
            Throw New FileNotFoundException(String.Format("{0} Not Found.", FileName))
        End If
 
        Dim WB As Workbook
 
        If GetFileEncoding(FileName) Is Encoding.UTF8 Then
            WB = FormatProvider.Import(GetUTF8(FileName))
        Else
            Using Data As FileStream = New FileStream(FileName, FileMode.Open)
                WB = FormatProvider.Import(Data)
            End Using
        End If
 
        Return WB
 
    End Function
 
    Function GetUTF8(Filename As String) As String
 
        Dim encodedBytes() As Byte = File.ReadAllBytes(Filename)
        Dim enc8 As Encoding = New UTF8Encoding(False, True)
        Dim decodedString As String = String.Empty
 
        Try
            decodedString += enc8.GetString(encodedBytes, 0, encodedBytes.Length)
        Catch e As DecoderFallbackException
 
            Dim sb As New StringBuilder
 
            For Each b As Byte In encodedBytes
                sb.Append(Microsoft.VisualBasic.ChrW(Convert.ToInt32(b)))
            Next
 
            decodedString = sb.ToString()
 
        End Try
 
        Return decodedString
 
    End Function
 
    Public Shared Function GetFileEncoding(srcFile As String) As Encoding
 
        ' Use Default of Encoding.Default (Ansi CodePage)
        Dim enc As Encoding = Encoding.UTF8
 
        ' Detect byte order mark if any - otherwise assume default
        Dim buffer As Byte() = New Byte(4) {}
        Dim file As New FileStream(srcFile, FileMode.Open)
        file.Read(buffer, 0, 5)
        file.Close()
 
        If buffer(0) = &HEF AndAlso buffer(1) = &HBB AndAlso buffer(2) = &HBF Then
            enc = Encoding.UTF8
        ElseIf buffer(0) = &HFF AndAlso buffer(1) = &HFE Then
            enc = Encoding.Unicode
        ElseIf (buffer(0) = &HFE AndAlso buffer(1) = &HFF) Then
            enc = Encoding.BigEndianUnicode
        ElseIf buffer(0) = 0 AndAlso buffer(1) = 0 AndAlso buffer(2) = &HFE AndAlso buffer(3) = &HFF Then
            enc = Encoding.Unicode
        ElseIf buffer(0) = &H2B AndAlso buffer(1) = &H2F AndAlso buffer(2) = &H76 Then
            enc = Encoding.UTF8
        End If
 
        Return enc
 
    End Function

Graeme
Top achievements
Rank 2
 asked on 18 Nov 2014
2 answers
926 views
Hello, I wonder if you can help with my issue.

In short, I am getting the exception (as in the post's title) when I get to the following line of code:


document = new RadFixedDocument();

RadFixedPage page = document.Pages.AddPage();
                
editor = new FixedContentEditor(page); // <<-- exception here



The things to note are:

1. No exception is thrown when the project is run from Visual Studio.

2. The exception is thrown when the merged assembly is run, that is after it has been merged with ILMerge.

3. The merging worked fine UNTIL I have added the Telerik.WinControls.PdfViewer.dll (and the related Telerik.Windows.Documents.Core.dll and  Telerik.Windows.Documents.Fixed) assemblies to ILMerge script and then tried to instantiate the FixedContentEditor when executing the merged assembly. 

That is, I have been using ILMerge for months with over 20 merged Telerik assemblies--no problem! It's only now that I started instantiating the FixedContentEditor so I assume it is the merged Telerik.Windows.Documents.Fixed.dll assembly that's throwing a wobbly somewhere.

By the way, the ILMerge throws no errors or warnings and the merging completes just fine. When I then run the merged assembly, it runs fine until I access the function that executes the code snipped above (that is, all other Telerik controls render correctly, etc.).

This seems to indicates it is not an issue with the ILMerge process per se. I wonder if there are some weird WPF dependencies somewhere. Even though it is a WinForms project and according to the Telerik documentation the FixedContentEditor can be used in WinForm applications, I noticed I had to refer to WindowsBase.dll in the project references because of two silly lines of code which refer to the System.Windows.Size struct.

    maxWidth = page.Size.Width - defaultLeftIndent * 2;   <<-- does not compile without WindowsBase.dll reference add
     maxHeight = page.Size.Height - currentTopOffset * 2; <<-- does not compile without WindowsBase.dll reference add



I have attached the merge script below and also screenshots my project references and successfully completed ILMerge process.

Thank you!

-----------------
merge.bat below


ilmerge /target:winexe /out:F:\OFFLINE\GULMAY\VMP1_Pro\Setup\VMP2.exe /targetplatform:"v4, C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" F:\OFFLINE\GULMAY\VMP1_Pro\VMP1Pro\VMP1Pro\bin\Release\VMP2.exe TelerikCommon.dll Telerik.WinControls.UI.dll Telerik.WinControls.dll Telerik.WinControls.Themes.Windows7.dll Telerik.WinControls.Themes.VisualStudio2012Light.dll Telerik.WinControls.Themes.VisualStudio2012Dark.dll  Telerik.WinControls.Themes.TelerikMetroBlue.dll Telerik.WinControls.Themes.TelerikMetro.dll Telerik.WinControls.Themes.Office2013Light.dll Telerik.WinControls.Themes.Office2013Dark.dll Telerik.WinControls.Themes.Office2010Silver.dll Telerik.WinControls.Themes.Office2010Blue.dll  Telerik.WinControls.Themes.HighContrastBlack.dll Telerik.WinControls.Themes.Desert.dll Telerik.WinControls.Themes.Breeze.dll Telerik.WinControls.Themes.Aqua.dll Telerik.WinControls.GridView.dll Telerik.Windows.Documents.Core.dll Telerik.Windows.Documents.Fixed.dll Telerik.Windows.Zip.dll Telerik.WinControls.PdfViewer.dll 











gulmay
Top achievements
Rank 1
 answered on 07 Nov 2014
1 answer
249 views
hi,

I'm trying to import an existing word template into a RadFlowDocument, edit it by filling the merge fields and display it on the screen (read-only).
Can anyone please assist me with this. The word templates also contains a header, which contains images and text boxes.
The File.OpenRead command returns an error, as it is unable to read the document into a stream (object reference not set to an instance of an object).
Petya
Telerik team
 answered on 21 Oct 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?