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
Hi,
we have editable PDFs which are stored in a database. We used to be able to pull the PDFs, import them through the Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider to get a RadFixedDocument, iterate through the fields of this document and fill them with data. Afterwards, we exported the PDF through the PdfFormatProvider and wrote them to a file. This gave us the original PDF but filled with the required data.
This does not work anymore, as the resulting exported PDF is visually broken. We have no clue why that happens, maybe you can help us fix this.
I attached a small sample project with our work flow including one of the PDFs we try to fill out and the resulting PDF for you to analyze.
Thanks a lot in advance.