Telerik Forums
Telerik Document Processing Forum
1 answer
406 views

How can I read Textfiles into string or into array without extract to temporary file before?

If not possible:

is there any c# example to read Textfiles to string from zip archive.

Tanya
Telerik team
 answered on 18 Jan 2018
14 answers
1.4K+ views

I am trying to Merge (embed) the Telerik.Documents.SpreadsheetStreaming.dll into my exe. I am able to add all of the DLL's that have referenced in my project with the exception of the one listed. I tried doing it via command line first and it did the same thing as it is when running it as a task in VS2017 Post Build Event.

 

It keeps coming back saying "It is still listed as an external reference in the target assembly."

 

Brian
Top achievements
Rank 1
Iron
Iron
 answered on 18 Jan 2018
1 answer
705 views

Hi,

I'm importing  html with RadFlowDocument document = htmlProvider.Import(html);
and exporting with htmlProvider.Export(document, stream);

I have two problems.

1. Why when html (HtmlFormatProvider) is exported, the css class is entered as an element style?
2. Why some elements are automatically added to the class (telerikNormal, TelerikTableNormal etc... I did't declare these classes )?

Can I turn off these options?

 

Many Thanks
Quop

Tanya
Telerik team
 answered on 16 Jan 2018
0 answers
418 views

Symptoms:
Most libraries from Telerik Document Processing are affected after you install January 9, 2018, .NET Security and Quality Rollup (KB4055002). Applications that request a fallback font or a character that is not included in the currently selected font return the following error messages:
System.TypeInitializationException
“FileFormatException: No FontFamily element found in FontFamilyCollection that matches current OS or greater: Win7SP1”.
Inner exception originates from: CompositeFontParser




Solution 1:

Microsoft has released an update which fixes the issue. More information about it you can find here: Description of the Security and Quality Rollup for .NET Framework 4.6, 4.6.1, 4.6.2, 4.7, and 4.7.1 for Windows 7 SP1 and Server 2008 R2 SP1 (KB 4074880).

Solution 2:


To keep .NET 4.7.1 installed and maintain protection against vulnerabilities that are addressed by the January security updates, uninstall the January .NET Framework Security and Quality Rollup (KB 4055002), and then install the January .NET Framework Security-Only Update (KB 4054183). To do this, follow these steps:

  1. In Control Panel, open the Windows Update item, and then select View update history.
  2. In the Review your update history list, locate and select Security Update for Microsoft .NET Framework 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1 (KB4055002). Then, select Uninstall.
  3. When you are prompted for confirmation to uninstall, select Yes.
  4. Restart your computer if you are prompted to do this.
  5. Download and install the Security Only update for .NET Framework 4.6, 4.6.1, 4.6.2, 4.7, and 4.7.1 for Windows 7 SP1 and Windows Server 2008 R2 SP1 and .NET Framework 4.6 for Windows Server 2008 SP2 (KB 4054183) for your operating system configuration from the following links:
    Security Only update for .NET Framework 4.6, 4.6.1, 4.6.2, 4.7, and 4.7.1 for Windows 7 SP1 and Windows Server 2008 R2 SP1 for x86 systems (KB4054183)
    Security Only update for .NET Framework 4.6, 4.6.1, 4.6.2, 4.7, and 4.7.1 on Windows 7 SP1 and Windows Server 2008 R2 SP1 for x64 systems (KB4055269)
  6. Follow the installation prompts, and then restart your computer if you are prompted to do this.

Solution 3:

 Roll back to the previous version of .NET Framework. To do this, follow these steps:

  1. In Control Panel, open the Programs and Features item.
  2. In the Uninstall or change a program list, locate and then select Microsoft .NET Framework 4.7.1, and then select Uninstall/Change.
  3. Select Remove .NET Framework 4.7.1 from this computer, and then select Next. 
  4. Select Continue to confirm the uninstallation.
  5. Select Finish after the uninstallation is finished. 
  6. Restart your computer if you are prompted to do this.
Tanya
Top achievements
Rank 1
 asked on 16 Jan 2018
0 answers
138 views

Hi All,

I have existing docx file which serves as my template. Margins, header and footer and text are all set. Text fields that will be replaced are all in { }. Just wondering how to make it multiple page single docx file with page breaks(pages are based on the number of recipients).  There will also be text replacement during process.

Right now the sample I see is creating all text and replacement from codebehind and not coming from an existing docx template ---> https://demos.telerik.com/aspnet-ajax/wordsprocessing/mailmerge/defaultvb.aspx

 

Any info that can get me started are very much appreciated.

Thanks in advance,

RJ

RJ
Top achievements
Rank 1
 asked on 15 Jan 2018
2 answers
190 views

Hi,

I am evaluating the use of SpreadProcessing for downloading an excel file created from a "template excel file" where cells are filled with values.

In order to change the template we are using named ranges to know where to place the values. On forum I have found a thread where this functionality was requested and someone provide a solution using ConvertCellNameToIndex.

However when I tried it I got an exception:

Telerik.Windows.Documents.Spreadsheet.Utilities.LocalizableException occurred
  HResult=-2146233088
  LocalizationKey=Spreadsheet_ErrorExpressions_InvalidRowName
  Message='4 evaluare'!$B$1' is invalid row name.
  Source=Telerik.Windows.Documents.Spreadsheet
  StackTrace:
       at Telerik.Windows.Documents.Spreadsheet.Utilities.NameConverter.ConvertRowNameToIndex(String rowName)
  InnerException: 
       HResult=-2146233079
       Message='4 evaluare'!$B$1' is invalid row name.
       InnerException: 

This is the cellName used => "='Anexa4 evaluare'!$B$1"

Is this an issue? What are my options in order to not get this error?

Tanya
Telerik team
 answered on 10 Jan 2018
7 answers
758 views

Hi,

 

I have an issue with converting between HTML and DOCX and vice versa. What happens is that I export an HTML unordered list to docx and then back from docx to HTML, using DocxFormatProvider and HtmlFormatProvider. The condensed code below illustrates my problem.

Version of Telerik.Windows.Document.* libraries is 2017.2.428.40, version of DocumentFormat.OpenXml is 2.5.5631.0.

 

var html = "<ul><li>1</li><li>2</li></ul>";
Console.WriteLine("Original HTML: "+html);
var docxFormatProvider = new DocxFormatProvider();
var htmlFormatProvider = new HtmlFormatProvider();
var document = htmlFormatProvider.Import(html);
var bytes = docxFormatProvider.Export(document);
document = docxFormatProvider.Import(bytes);
htmlFormatProvider.ExportSettings.DocumentExportLevel = DocumentExportLevel.Fragment;
htmlFormatProvider.ExportSettings.StylesExportMode = StylesExportMode.None;
htmlFormatProvider.ExportSettings.IndentDocument = false;
html = htmlFormatProvider.Export(document);
Console.WriteLine("New HTML: "+html);
Console.ReadKey();

 

The console output is:

Original HTML: <ul><li>1</li><li>2</li></ul>
New HTML: <body><ul style="list-style-type: disc;"><li style="font-family: Symbol;" value="1"><span style="font-family: Times New Roman;">1</span></li><li style="font-family: Symbol;" value="2"><span style="font-family: Times New Roman;">2</span></li></ul></body>

 

The ooxml generated when exporting the HTML to docx is:

  <w:body>
    <w:p>
      <w:pPr>
        <w:pStyle w:val="NormalWeb" />
        <w:numPr>
          <w:ilvl w:val="0" />
          <w:numId w:val="1" />
        </w:numPr>
        <w:rPr />
      </w:pPr>
      <w:r>
        <w:rPr />
        <w:t>1</w:t>
      </w:r>
    </w:p>
    <w:p>
      <w:pPr>
        <w:pStyle w:val="NormalWeb" />
        <w:numPr>
          <w:ilvl w:val="0" />
          <w:numId w:val="1" />
        </w:numPr>
        <w:rPr />
      </w:pPr>
      <w:r>
        <w:rPr />
        <w:t>2</w:t>
      </w:r>
    </w:p>
    <w:sectPr />
  </w:body>
</w:document>

 

What puzzles me is the style definitions on the exported html, for instance font-family: Symbol; on the list elements. We're using the JavaScript API for Office to inject the exported HTML into content controls in Word documents. The example HTML here injects a bullet list in the content control, but if the user adds new bullets to the list in word the font is set to Symbol. Also, I don't understand why spans with font-family Times New Roman is added, this is causing some line spacing issues and we are using Arial as standard.

 

Does anyone have some input on this? Thanks.

 

Best regards,

Geir Morten Hagen

Tanya
Telerik team
 answered on 10 Jan 2018
8 answers
1.0K+ views

Hello,
I'm having trouble breaking a new page using HtmlFormatProvider and PdfFormatProvider

My code

var html = "<h1>firstpage</h1><?hard-pagebreak?><h1>secondpage</h1>";
HtmlFormatProvider prov = new HtmlFormatProvider();
RadFlowDocument document = prov.Import(html);
 
var provider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
var ouput = provider.Export(document);
File.WriteAllBytes(@"D:\a.pdf", ouput);

 

What am I doing wrong ?

 

 

Tanya
Telerik team
 answered on 29 Dec 2017
1 answer
150 views

Is there a way to use a Worksheet "Or Convert it to" a dataSource that would be compatible with RadGridView?

I'm currently working on building a list from the activeWorksheet but it cause multiple issues "Header name, Columns Type, ect..

 

Thank you!

Peshito
Telerik team
 answered on 25 Dec 2017
10 answers
243 views

Hello, Telerik,

 

Is Conditional Formatting supported in RadSpreadProcessing? If not, will it be ever available?

Tanya
Telerik team
 answered on 27 Nov 2017
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?