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."
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.
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?
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.
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!
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)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
}
PdfFormatProvider pdf = new PdfFormatProvider();
return pdf.Export(html);
Thanks in advance for the help.
Darwin Pinder