Telerik Forums
Telerik Document Processing Forum
4 answers
1.3K+ views

We recently upgraded Sitefinity 9.1 to Sitefinity 11.0.

We process excel spreadsheets using "Telerik.Windows.Documents.Spreadsheet.Model" which references Telerik.Windows (2015.1.225.45) nuget package with .Net Framework 4.5

Sitefinity 11 uses .Net Framework 4.7.1 and seems like "Telerik.Windows.Documents.Spreadsheet.for.Net40" is the replacement for "Telerik.Windows.Documents.Spreadsheet.Model"? Is this true? If so I'm trying to download ...for.Net40 from Telerik nuget and I get an following error-

 

Unable to resolve dependency 'Telerik.Windows.Zip.for.Net40'.

I could not find this from Telerik's nuget package. Am I heading in the right direction? Appreciate help in advance.

 

 

Polya
Telerik team
 answered on 02 Oct 2018
1 answer
1.0K+ views

I want to create the RadFlowDocument in Landscape.  I used the Section.  But I don't know how to use Section to insert text and insert line.  Is there  a easy way to change the whole document to Landscape mode?

Currently, I only find a full example of using editor.InsertText and editor.InsertLine.  So, I am using the same method.  Adding section could only change the margin, not the page orientation for whole document.

Section section = new Section(doc);
doc.Sections.Add(section);
section.PageMargins = new Telerik.Windows.Documents.Primitives.Padding(40, 40, 40, 40);
section.PageOrientation = PageOrientation.Landscape;
section.Rotate(PageOrientation.Landscape);

editor.InsertLine...

Thanks.

 

 

 

Georgi
Telerik team
 answered on 27 Sep 2018
6 answers
1.2K+ views

Hi, 

I have data in IList and i am trying to export the same to excel(.xls or .xlsx any one). But i am getting the exception.  So if any one can put a light on it.
                                for (var i = 0; i < this.RowList.Count; i++)
                                {
                                    for (var j = 0; j < this.Columns.Count; j++)
                                    {
                                          worksheet.Cells[i, j].SetValue("Test");
                                    }
                                }                          
                        if (workbook != null)
                        {                           
                            XlsxFormatProvider formatProvider = new XlsxFormatProvider();                         
                            formatProvider.Export(workbook, stream);                           // Exception  here                   
                        }

 

{System.TypeInitializationException: The type initializer for 'Telerik.Windows.Documents.Spreadsheet.Measurement.FontManager' threw an exception. ---> System.UnauthorizedAccessException: Invalid cross-thread access.
   at MS.Internal.XcpImports.CheckThread()
   at MS.Internal.XcpImports.Font_GetSystemGlyphTypefaces()
   at System.Windows.Media.Fonts.get_SystemTypefaces()
   at Telerik.Windows.Documents.Spreadsheet.Measurement.FontManager..cctor()
   --- End of inner exception stack trace ---
   at Telerik.Windows.Documents.Spreadsheet.Measurement.FontManager.IsMonospaced(String fontFamily)
   at Telerik.Windows.Documents.Spreadsheet.Model.FontProperties.get_IsMonospaced()
   at Telerik.Windows.Documents.Spreadsheet.Measurement.RadTextMeasurer.Measure(String text, FontProperties fontProperties, Nullable`1 wrappingWidth)
   at Telerik.Windows.Documents.Spreadsheet.Measurement.RadTextMeasurer.MeasureMultiline(String text, FontProperties fontProperties, Nullable`1 wrappingWidth)
   at Telerik.Windows.Documents.Spreadsheet.Layout.LayoutHelper.CalculateCellContentSize(ICellValue cellValue, CellValueFormat format, FontProperties fontProperties, Int32 indentFactor, Nullable`1 wrappingWidth)
   at Telerik.Windows.Documents.Spreadsheet.Layout.LayoutHelper.CalculateAutoColumnWidth(Worksheet worksheet, Int32 columnIndex, Int32 fromRowIndex, Int32 toRowIndex, Boolean respectNumberValuesOnly)
   at Telerik.Windows.Documents.Spreadsheet.Model.ColumnSelection.<>c__DisplayClass8.<AutoFitWidth>b__7(CellRange cellRange)
   at Telerik.Windows.Documents.Spreadsheet.Model.SelectionBase.ExecuteForEachRange(IEnumerable`1 cellRanges, Action`1 action, Predicate`1 canExecute)
   at Telerik.Windows.Documents.Spreadsheet.Model.SelectionBase.ExecuteForEachRangeInsideBeginEndUpdate(IEnumerable`1 cellRanges, Action`1 action, Predicate`1 canExecute)
   at Telerik.Windows.Documents.Spreadsheet.Model.ColumnSelection.AutoFitWidth(Boolean expandOnly)
   at Telerik.Windows.Documents.Spreadsheet.Model.CellSelection.<>c__DisplayClass1`1.<SetPropertyValue>b__0(CellRange cellRange)
   at Telerik.Windows.Documents.Spreadsheet.Model.SelectionBase.ExecuteForEachRange(IEnumerable`1 cellRanges, Action`1 action, Predicate`1 canExecute)
   at Telerik.Windows.Documents.Spreadsheet.Model.SelectionBase.ExecuteForEachRangeInsideBeginEndUpdate(IEnumerable`1 cellRanges, Action`1 action, Predicate`1 canExecute)
   at Telerik.Windows.Documents.Spreadsheet.Model.CellSelection.SetPropertyValue[T](ICellProperty`1 property, T value)
   at Telerik.Windows.Documents.Spreadsheet.Model.CellSelection.SetValueInternal(ICellValue cellValue, CellValueFormat newFormat)
   at Telerik.Windows.Documents.Spreadsheet.Model.CellSelection.SetValue(String value)
   at OnGuard.Connext.FrontEnd.Library.SL.ViewModel.ExportOptionsViewModel.ExportToFile()}

Zim
Top achievements
Rank 1
 answered on 20 Sep 2018
4 answers
317 views

Hello,

 

We have been trying to use create a service for automatic document signing.

Right now we have two problems:

1) When you sign a document through acrobat, it gives you an option of locking the document. If you do this, on the signature properties you can read something like: "The certifier has specified that no changes are allowed to be made to this document."

Do we have access to any variable that grants control over this behaviour?

2) When signing a pdf with a digital certificate, the signing time includes the time zone for example: "2018/09/11 12:07:20 + 01'00'". Is there any way to retrieve the same format so we can put it on the appearance? (If we just use the signatureField.Signature.Properties.TimeOfSigning.toString(), it does not include the timezone)

 

I'll be willing to supply any other code necessary.

Thank you in advance.

Inelcis
Top achievements
Rank 1
 answered on 20 Sep 2018
5 answers
239 views
Hi.

I have recently started using the ZipLibrary and I am facing an issue when adding streams to a ZipPackage.  I am trying to add two streams to the ZipPackage, one for a PowerPoint file and the other for a Excel file.  Once it is packaged, I want to write it to the OutputStream.  Before I add the streams to the package, their size is significantly larger and have data because when I export them as individual streams (outside of a zip) it works just fine.  Once added it looks like they lose all of their data and when it outputs, the PPTX and XLSX files are empty and corrupt respectively.

Here is my code below as well as the SendZipToClient snippet from another forum post, is there anything wrong with it or is it an issue from the ZipLibrary?

Additional Info:
.NET version: 4.5
Current Browser: FireFox 21.0
Telerik version for ASP.NET AJAX: 2013.1.417.45
Language: C#


private void StreamReports(Dictionary<int, MemoryStream> ReportStreams)
{
      string destPPTXFile = string.Format("{0}.pptx", txtPresentationName.Text);
      string destXLSXFile = string.Format("{0}.xlsx", txtPresentationName.Text);
 
      MemoryStream outputStream = new MemoryStream();
      ZipPackage zipPackage = ZipPackage.Create(outputStream);
 
      MemoryStream powerpointStream = ReportStreams[0];
      MemoryStream excelStream = ReportStreams[1];
 
      zipPackage.AddStream(powerpointStream, destPPTXFile);
      zipPackage.AddStream(excelStream, destXLSXFile);
 
      SendZipToClient(outputStream, zipPackage);
 
 }

private void SendZipToClient(MemoryStream memStream, ZipPackage Package)
        {
            string destFile = string.Format("{0}.zip", txtPresentationName.Text);
            Package.Close(false);
            memStream.Position = 0;
            if (memStream != null && memStream.Length > 0)
            {
                Response.Clear();
                Response.AddHeader("content-disposition", "attachment; filename=\"" + destFile);
                Response.ContentType = "application/zip";
                Response.BufferOutput = false;   // to prevent buffering
                byte[] buffer = new byte[1024];
                int bytesRead = 0;
                while ((bytesRead = memStream.Read(buffer, 0, buffer.Length)) > 0)
                {
                    Response.OutputStream.Write(buffer, 0, bytesRead);
                }
 
                Response.End();
            }
        }
Tom
Top achievements
Rank 1
 answered on 18 Sep 2018
4 answers
430 views

I have the following code which fails at the `.Import` statement:

public byte[] PopulateHtmlAndTextBookmarks(byte[] input, List<BookmarkInfo> bookmarks)
{
    // Get the bytes into the Telerik doc object and load that into an editor
    DocxFormatProvider provider = new DocxFormatProvider();
    RadFlowDocument document = provider.Import(input);

 

The error is "System.ArgumentNullException: 'Value cannot be null. Parameter name: relationshipId'"

The issue appears to be that I have two images in that file (Open XML relationship IDs "rId7" and "rId8") that point to external URLs.  If I change those images to point at files inside the DocX container it works fine.

Does DocxFormatProvider work with external image links?   

(I'm using 2018.2.619.40)

PS I've tried to attach the file but it says only .jpg, .jpeg, .gif, .png are allowed

Georgi
Telerik team
 answered on 18 Sep 2018
4 answers
779 views
Is it possible using Telerik's tools to get at the OpenXML file in a Word document?
Petya
Telerik team
 answered on 13 Sep 2018
1 answer
413 views
Is it possible using PdfProcessing?
Polya
Telerik team
 answered on 12 Sep 2018
3 answers
217 views
Language: VB.NET

Hello,

I'm looking to use CompressedStream solution without really understanding its use.

What I am trying to do:
1. compress file.
2. Insert the compressed file into my Database.
3. Retrieve compressed file to unzip it.
4. Read file.

How can I efficiently compress the file ?
Which method should I use ?
What type of variable should I deal with ? (String, Byte ()?)

Would you have a functional example in .net to help me ?

Thanks for your help
Tanya
Telerik team
 answered on 07 Sep 2018
1 answer
636 views

Hello!

I'm trying to add fields from a database into a pdf like the image attached shows. I already read the FormFieldCollection documentation, but I'm lacking the knowledge to make it work.

 

Can someone please include a code example on how to do this ?

Polya
Telerik team
 answered on 07 Sep 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?