I need pdf landscape orientation.
I export document, then change size:
pdf = pdfFlowProvider.ExportToFixedDocument(doc); pdf.Pages[0].Size = new Size(1056, 816);
Problem that I have lot of space on the right side, probably because I exported document first.
But I can't change page size before this, because I don't have pages.
How to fix this?
I can rotate in RadFixedDocumentEditor using SectionProperties.PageRotation, but if I use
using (RadFixedDocumentEditor editorDocument = new(document))
{
editorDocument.SectionProperties.PageRotation = Rotation.Rotate90;
editorDocument.InsertRun("Test Run.");
}
using the tutorial on:
I have this code:
Workbook workbook;
IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsm.XlsmFormatProvider();
using (Stream input = new FileStream(FileName, FileMode.Open))
{
workbook = formatProvider.Import(input);
}
when trying to open the file I get the following error:
Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
I have not done anything to the file other than attempt to open the file. Some files can be opened, but many throw this error. I cannot determine what the problem is and can't figure out what the 'index' is that's being referred to.
I am following the guide to create a PDF (First Steps | Telerik Document Processing)
I installed the UI for ASP.NET Core. I could find the three DLLs referenced in the example but the documentation states: for .NET Core/.NET 5+ project the additional DLLs are required:
Where are these dll's located?

I would like to add a superscript to text I am adding to a block. I tried adding the text to a block, and then a TextFragment to the block, but I can't seem to move the text up as a superscript.
block.InsertText(text ?? string.Empty);
var frag = new TextFragment(superscript);
frag.FontSize = fontSize - 2;
block.Insert(frag);I tried using frag.TextRise but it doesn't seem to affect the vertical offset of the fragment no matter what values I use. I also tried using frag.Position, but that doesn't affect it either. Clearly I am missing something. Perhaps I should use another approach?
Thanks in advance,
Dudley Chapman
I am starting with the Telerik Document processing libraries. I have a simple excel file that I would like to import into a list to work with in my program.
I have an imported workbook and worksheet that seems to work. When I try to get the data from a test cell however:
string test; test = sheet.Cells[0,0].GetValue().ToString();
instead of returning the value I put in the cell I get:
"Telerik.Windows.Documents.Spreadsheet.Model.RangePropertyValue`1[Telerik.Windows.Documents.Spreadsheet.Model.ICellValue]"
I have been reading the documentation and can't figure out what I am doing wrong.
(for the record:
test = sheet.Cells[0,0].GetValue().Value.ToString(); returns
"Telerik.Windows.Documents.Spreadsheet.Model.NumberCellValue"
so it isn't helpful either.)
Hi all,
Were using Telerik libraries for .Net Framework are trying to import an existing docx file and then export it as a PDF. While doing this we noticed that after importing the docx file using DocxFormatProvider the existing table on the docx file selects the wrong theme.
We want to use 'Grid Table 4 - Accent 5' but after the import, the table style gets converted to 'Grid Table 4 - Accent 1'. We can't really specify a direct table style since the document that will be imported and converted to a PDF can have different table styles.
Is there a way to make this work with our current table style and other table styles? Here's the nuget packages we currently have installed to the project
And here's the code we are using
public static byte[] ConvertDocxToPdf(byte[] inputStream, Core.Models.Common.Document.Watermark watermark = null)
{
var docxFormatProvider = new DocxFormatProvider();
var radFixedDocumentProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
var radFlowDocument = docxFormatProvider.Import(inputStream);
var radFlowDocumentEditor = new RadFlowDocumentEditor(radFlowDocument);
if (watermark != null)
{
var watermarkSettings = new TextWatermarkSettings()
{
Text = watermark?.Text,
FontFamily = new System.Windows.Media.FontFamily(watermark.FontName),
Angle = watermark.Angle,
Height = watermark.FontHeight,
Width = watermark.FontWidth,
ForegroundColor = ToMediaColor(watermark.Color),
Opacity = watermark.Opacity
};
var textWatermark = new Telerik.Windows.Documents.Flow.Model.Watermarks.Watermark(watermarkSettings);
for (int i = 0; i < radFlowDocumentEditor.Document.Sections.Count(); i++)
{
var sectionToModify = radFlowDocumentEditor.Document.Sections[i];
var header = sectionToModify.Headers.Default;
var copyWatermark = textWatermark.Clone();
if (header == null)
{
header = sectionToModify.Headers.Add(HeaderFooterType.Default);
}
radFlowDocumentEditor.SetWatermark(copyWatermark, header);
}
}
return radFixedDocumentProvider.Export(radFlowDocument);
}
Also, here's the table we are importing
And after importing as a RadFlowDocument, if we do radFlowDocumentEditor.Export and then save the bytes as a docx file, this is the resulted table
Thanks in advance!
