Telerik Forums
Telerik Document Processing Forum
1 answer
362 views

After upgrading the Telerik Document Processing libraries to version Q1 2025 the following error messages may occur:

* "The file or assembly cannot be loaded 'Telerik.Licensing.Runtime, Version=1.4.6.0, Culture=neutral, PublicKeyToken=token_here' or one of its dependencies. The system cannot find the specified file."

* "NU1101: Unable to find package Telerik.Licensing. No packages exist with this id in source(s): Telerik nuget. PackageSourceMapping is enabled, the following source(s) were not considered: Microsoft Visual Studio Offline Packages, nuget.org."

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 12 Feb 2025
1 answer
116 views
Is Telerik's NuGet server currently down or experiencing any issues? I'm unable to install packages from the Telerik feed, and I want to confirm if it's a known outage.
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 25 Nov 2024
1 answer
13 views

We need to print a GridView and are implementing the code found in "GridView | Print and Print Preview" example in the WPF Desktop Examples 2024 Q4  app but are encountering two issues also present in the Telerik-provided example.

1) Changes made in Print Preview are not carried over when the Print button is pressed.  For example, if you change to Landscape/Legal in Print Preview, this will revert back to Portrait/Letter when Print is clicked.

2) Clicking Print on the Print Preview window shoves the Print Preview window to the background and if Cancel is clicked on the Print window, the user has to Alt-Tab through windows to find the Print Preview window to close it.

Stenly
Telerik team
 answered on 24 Apr 2025
2 answers
18 views

We need to set a spreadsheet font to Courier New in a WPF app using telerik.ui.for.wpf.60.xaml\2024.2.514.  As a first step, we do:

using System.Windows;
using Telerik.Documents.Common.Model;

namespace WpfApp4;

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        var fontFamily = new ThemableFontFamily("Courier New");
    }
}

Which is fine until we add a required cross-platform project referencing telerik.documents.core\2024.2.426

Then we get:

The type 'ThemableFontFamily' exists in both 'Telerik.Documents.Core, Version=2024.2.426.20, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' and 'Telerik.Windows.Documents.Core, Version=2024.2.426.60, Culture=neutral, PublicKeyToken=5803cfa389c90ce7'

Ambiguous reference.
Candidates are:
Telerik.Documents.Common.Model.ThemableColor
Telerik.Documents.Common.Model.ThemableColor

What is the proper fix for this to reference the version in the WPF app project?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 10 Apr 2025
1 answer
9 views
Is it possible to add text to headers based on variables/database fields? I'm trying to loop through a table and use a field within the table as a page title, but all information I could find on this points to it being impossible in Telerik. Guidance would be much appreciated. 

Thanks
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 07 Apr 2025
1 answer
18 views

I am doing some document processing and want to use Telerik to display and edit. I need access to the paraId and textId elements of the docx "document" XML. I have explored the object model in the debugger and do not see these attributes. Are they available in the imported model?

Thanks.

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 Mar 2025
1 answer
29 views
Im using:
var xlsxProvider = new XlsxFormatProvider();
var pdfFormatProvider = new PdfFormatProvider();

byte[] docBytes = File.ReadAllBytes(path);
Workbook workbook = xlsxProvider.Import(docBytes, null);

byte[] resultBytes = pdfFormatProvider.Export(workbook, null);
File.WriteAllBytes(resultPath, resultBytes);

to conver xlsx file to pdf. In source xlsx file a have a Table and a formula '=SUBTOTAL(109, Table2[...]) that work in xlsx, but when i export it to PDF i need to have the calculated value, but instead im getting the string  '=SUBTOTAL(109, Table2[...]) . 

Is there a simple way to force calculation of all formulas in the sheet before exporting it to PDF?
Yoan
Telerik team
 answered on 28 Feb 2025
1 answer
35 views

The contents of an uploaded .docx file is being cut-off when converted to .pdf file.

 

Code snippet:

var fileFormatProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider(); using (MemoryStream inputFileStream = new MemoryStream()) { this.fileSystemService.GetFile(documentInfo, inputFileStream); if (fileFormatProvider != null) { var document = fileFormatProvider.Import(inputFileStream); using (MemoryStream output = new MemoryStream()) { var pdfProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider(); pdfProvider.Export(document, output); var newFile = new DocumentInfo() { NameWithPath = outputFileName, DocumentLocation = documentInfo.DocumentLocation }; this.fileSystemService.SaveFile(newFile, output); } }

 

Can someone confirm if this a Telerik side issue, or am I missing a setting or config?

 

Thanks!

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 Feb 2025
0 answers
23 views

Can someone help me figure out what is wrong here?  I'm getting ad horribly vague Null exception.

 

var docxProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider();
var pdfProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
RadFlowDocument document = new RadFlowDocument();
byte[] docBytes = File.ReadAllBytes(path);

document = docxProvider.Import(docBytes);    ERROR HERE

var resultBytes = pdfProvider.Export(document);

File.WriteAllBytes(resultPath, resultBytes);

 

The document i'm trying to load contains tables and images within the tables (jpeg barcodes)

I have verified that pretty much every other tool i use can read the file without issue. 

The goal is ultimately to export the file as a PDF.

 

Error details:

{"Object reference not set to an instance of an object."}

   at Telerik.Windows.Documents.Flow.FormatProviders.Docx.Model.Elements.Document.ParagraphPropertiesElement.OnAfterRead(IDocxImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase`3.OnAfterRead(IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.ReadChildElements(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Elements.OpenXmlElementBase.Read(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Parts.OpenXmlPartBase.Import(IOpenXmlReader reader, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.Model.Parts.OpenXmlPartBase.Import(Stream stream, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlImporter`1.ImportPartFromArchive(ZipArchiveEntry zipEntry, PartBase part, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlImporter`1.Import(Stream input, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider.ImportOverride(Stream input)
   at Telerik.Windows.Documents.Common.FormatProviders.FormatProviderBase`1.Import(Stream input)
   at Telerik.Windows.Documents.Common.FormatProviders.BinaryFormatProviderBase`1.Import(Byte[] input)
   at IVC_BIPS_Desktop.rfrmMain.ConverDocxToPdf(String path, String resultPath) in C:\Source\IVC Batch Instructions Printing\IVC_BIPS_Desktop\rfrmMain.cs:line 499
Jamie
Top achievements
Rank 1
 asked on 20 Feb 2025
1 answer
24 views

I am trying to convert HTML to a PDF document with 0.25" margins. The left and right margins are being set correctly, but the top and bottom margins remain 0.5".  My code is below, a screenshot of the generated PDF is attached.

                StringBuilder sb = new StringBuilder();

                foreach (string row in data)
                    sb.AppendLine(row);

                HtmlFormatProvider provider = new HtmlFormatProvider();
                RadFlowDocument html = provider.Import(sb.ToString());

                foreach (Section section in html.Sections)
                {
                    section.PageMargins = new Telerik.Windows.Documents.Primitives.Padding(24, 24, 24, 24); 

                    // Code snippet from function that adds header inserted below

                    Header header = section.Headers.Add();
                    Table table = header.Blocks.AddTable();
                    Border border = new Border(1, BorderStyle.Single, new ThemableColor(Colors.Black));
                    table.Borders = new TableBorders(border);
            
                    TableRow row1 = table.Rows.AddTableRow();
                    row1.Height = new TableRowHeight(HeightType.Exact, 30);
            
                    TableCell Title = row1.Cells.AddTableCell();
                    Paragraph pTitle = Title.Blocks.AddParagraph();
                    Run rTitle = pTitle.Inlines.AddRun(FormName);
                    Title.PreferredWidth = Inches(3.99);
                    Title.Shading.BackgroundColor = gray;
                    Title.VerticalAlignment = VerticalAlignment.Center;
                    rTitle.FontWeight = FontWeights.Bold;
                    rTitle.FontSize = 16;

                    // Call to similar code for adding footer

                }

                PdfFormatProvider pdf = new PdfFormatProvider();
                return pdf.Export(html);

 

Thanks in advance for the help.

Darwin Pinder

Yoan
Telerik team
 answered on 28 Jan 2025
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?