Telerik Forums
Telerik Document Processing Forum
1 answer
36 views
Please help with adding some text into run with substring numbers (chemical formula)
How to do this?
Yoan
Telerik team
 answered on 18 Dec 2023
1 answer
39 views

I'm trying to convert a word document to PDF and the images and shapes it contains, along with their text, do not make it into the PDF. Are these not yet supported? 

The attached zip contains the original document and the result of the conversion.

The conversion code is pretty straightforward, basically just

DocxFormatProvider docxProvider = new DocxFormatProvider();
var pdfProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
RadFlowDocument document = null;

using (Stream input = File.OpenRead("WordDocWithGraphics.docx"))
{
    document = docxProvider.Import(input);
}

using (Stream output = File.OpenWrite(("WordDocWithGraphics.pdf"))
{
    pdfProvider.Export(document, output);
}

Yoan
Telerik team
 answered on 18 Dec 2023
1 answer
40 views

I have an HTML code with hyperlinks in the text, this must be converted to rtf and the hyperlinks in the text need to be removed, but I did not find a way to remove the hyperlink/uri.

Is there an example for that?

Vladislav
Telerik team
 updated answer on 13 Dec 2023
1 answer
71 views

I am writing an application that that generates a pdf presentation based on a pdf "template" file.  The template file contains one or more images. The application replaces the images in the template file with other images the user has called out. 

How can I name or "tag" the placeholder images in the template file in order to identify what goes where?   

I thought of using the accessibility/alternative text field of each image but I understand that is not currently accessible via the Telerik library.

Are there other fields I could use to place identifiers assocated with the images?

I want to use Adobe acrobat to edit the template file and add the tags if possible.

Thanks. 

Yoan
Telerik team
 answered on 30 Nov 2023
1 answer
76 views

I need to open a spreadsheet from a template in my project.  I'm referencing this article: https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/working-with-workbooks/create-open-and-save-workbooks#open-a-workbook

The immediate issue I have is I don't think I have the right libraries.  I'm starting just trying to open the file.  I get an namespace error.


public async Task PopulateReport()
{
    string filePath = "~/misc/report_template.xlsx";

    Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook;
    // the XLSX format provider is used for demo purposes and can be replaced with any format provider implementing the IWorkbookFormatProvider interface
            IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();

    using (Stream input = new FileStream(filePath, FileMode.Open))
    {
        workbook = formatProvider.Import(input);
    }
}

 

I have the Telerik.UI.for.Blazor package installed.  My understanding was that document processing was included.  What am I missing?  I guess its worth mentioning I don't have a login to Telerik Nuget.  I think it has to do with my company's licensing, I downloaded the package from an internal website.

Chris
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 13 Nov 2023
1 answer
56 views

I have data like this in CLOB field in the database. When a user downloads the data, it's converted to an Excel file using OpenXML.

Customer name¤Active¤customer id¤agreement name¤agreement id¤fund isin¤fund id¤rate active¤agreement active¤agreement vp key type¤agreement vp number¤rate type¤rate commision

I am converting the site so it can run in Kubernetes using the Blazor UI components. Today it's an old MVC site.

So how can I convert all the lines of code to an Excel sheet without using too much memory?

Each CLOB is around 32mb.

Yoan
Telerik team
 answered on 02 Nov 2023
1 answer
31 views

I'm trying to use the "ExportToHTML" object but it won't let me. I already implemented the two necessary libraries but it still won't let me use the object.

using Telerik.WinControls.Export;
using Telerik.WinControls.UI.Export;

 

Any solution? 

Dinko | Tech Support Engineer
Telerik team
 answered on 30 Oct 2023
2 answers
418 views

Greetings All,

Is there any way that the text that i am entrering into Block can be formated for Underline and Strikethrough .

 

I was able to achieve other properties like Bold , Italix with statements like 

block testblock =testCell.Blocks.AddBlock();

testblock. TextProperties.Font = FontsRepository.TimesItalic;

 

 

Luk
Top achievements
Rank 1
Iron
 updated answer on 06 Oct 2023
1 answer
61 views

Hi,

I get HTML in my code and I have the image byte in another file. I want to combine it to export my HTML to PDF with images. This is what I do, and it only works with a single image, on the second iteration I got an error in importSettings.LoadImageFromUri (Method = <Internal Error evaluating expression>). What can I do to add multiple images in the importSettings? I don't see an example in the documentation.


foreach (var img in imageList)
{               
  EventHandler<LoadImageFromUriEventArgs> loadImageFromUri = (s, e) =>
  {
    
    byte[] data = img.ContentBytes;
    e.SetImageInfo(data, "jpg");
  };

  importSettings.LoadImageFromUri += loadImageFromUri;                          
}

Thanks

Martin
Telerik team
 answered on 03 Oct 2023
1 answer
131 views

We store some texts in rtf-format in our database. Now I have to convert them to html.

This is an expample of the rtf-text:

{\rtf1\ansi\ansicpg1252\deff0\deflang2055{\fonttbl{\f0\fnil\fcharset0 Arial;}{\f1\fnil\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\fs20 Dampf- und Gassperre aus Fl\'fcssigkunststoff f\'fcr D\'e4mmung von K\'e4lteleitungen. Flexible, schwerentflammbare und dampfbremsende Beschichtung auf Wasserbasis. Auch geeignet zum Schutz von l\'f6sungsmittelempfindlichen Isolierstoffenbei K\'e4lte-Isolierungen im Innen- und Aussenbereich.\f1\fs17\par
}

To convert it to html I use the following code:

Telerik.Windows.Documents.Flow.FormatProviders.Rtf.RtfFormatProvider rtfProv = new();
      Telerik.Windows.Documents.Flow.Model.RadFlowDocument rtfDoc = rtfProv.Import(rtfInput);
      
      Telerik.Windows.Documents.Flow.FormatProviders.Html.HtmlExportSettings expSettings = new()
      {
        DocumentExportLevel = Telerik.Windows.Documents.Flow.FormatProviders.Html.DocumentExportLevel.Fragment,
        StylesExportMode = Telerik.Windows.Documents.Flow.FormatProviders.Html.StylesExportMode.None,
      };
      Telerik.Windows.Documents.Flow.FormatProviders.Html.HtmlFormatProvider htmlProv = new() 
      { 
        ExportSettings = expSettings 
      };
      string ret = htmlProv.Export(rtfDoc);
      return new HtmlString(ret);
This code works . The output looks like this:
<body><p style="margin-bottom: 0px;"><span style="font-size: 13.333333333333334px;">Dampf- und Gassperre aus Fl&uuml;ssigkunststoff f&uuml;r D&auml;mmung von K&auml;lteleitungen. Flexible, schwerentflammbare und dampfbremsende Beschichtung auf Wasserbasis. Auch geeignet zum Schutz von l&ouml;sungsmittelempfindlichen Isolierstoffenbei K&auml;lte-Isolierungen im Innen- und Aussenbereich.</span></p></body>
How can I remove or replace the style-attribute with the font-size in the span?
Anna
Telerik team
 answered on 29 Sep 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
MIS
Top achievements
Rank 1
Ross
Top achievements
Rank 1
Marcin
Top achievements
Rank 1
Iron
Iron
Sean
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?