I created a test docx with the following text in a justified format:
"This is a brand-new document with justified text. Putting extra text into the paragraph in order to highlight the specific justified format text. This is simply test text in order to demonstrate the issue that I am having when I attempt to use the Telerik rad document find all."
I then upload the document into Session and save the file binary by converting the File.InputStream to Base64Stream.
I then create a find text of "This is simply test text".
The resulting IReadOnlyCollection<FindResult> of editor.FindAll(txtFind, false, true); contains one result with three runs.
"highlight the specific justified format text. This is simply"
"test"
"text in order to demonstrate the issue that I am having when I attempt to use the Telerik rad document find all.
I had assumed that setting match whole word would return a better result, but it does not.
I think I do not understand the concept of "runs". There is no other formatting other than justification.
I expected either the sentence that the text resides in to return OR the entire paragraph. Not three incomplete sentences, one just including one word.
Please try wps application to open docx file that generated by telerik document processing. www.wps.cn
header and footer are not displayed .
file was generated by ASP.NET Core WordsProcessing Key Features Demo | Telerik UI for ASP.NET Core
Hi,
I'm working on document word processing. My task is quite simple, basically I need to take a DOCX template, manipulate it by replacing some fields, with values taken from other parts, and adding some TableRow on it and, finally, I need to export it into PDF format.
This works but unfortunaley the PDF I see is not equal to the docx template from where I start, so do you know some workaround that may help me to fix this issue.
Thank you for your attention.
Hello,
I have a weird situation, that the line:
run.FontWieght = FontWieghts.Bold;
doesn't work.
in second hand, every other character attribute is working perfectly (like FontStyle, FontUnderline, Font size and so on).
can anyone guess what could be the issue?
Hello,
i'm trying to convert some docx to PDF. The resulting document looks quite similar to the original, however i have 2 main issues:
i've attached a very simple example.
Here is the code i'm using to generate the pdf:
public byte[] Convert()
{
//to support fonts
Telerik.Windows.Documents.Extensibility.FontsProviderBase fontsProvider = new FontsProvider();
Telerik.Windows.Documents.Extensibility.FixedExtensibilityManager.FontsProvider = fontsProvider;
//to support PNG's
Telerik.Windows.Documents.Extensibility.JpegImageConverterBase jpegImageConverter = new Telerik.Documents.ImageUtils.JpegImageConverter();
Telerik.Windows.Documents.Extensibility.FixedExtensibilityManager.JpegImageConverter = jpegImageConverter;
var importProvider = new DocxFormatProvider();
byte[] templateData = GetTemplateData();
var template = importProvider.Import(templateData);
var pdfProvider = new PdfFormatProvider();
PdfExportSettings settings = new();
settings.ComplianceLevel = PdfComplianceLevel.PdfA3U;
pdfProvider.ExportSettings = settings;
var pdfBytes = pdfProvider.Export(template);
return pdfBytes;
}
//... end class
public class FontsProvider : Telerik.Windows.Documents.Extensibility.FontsProviderBase
{
public override byte[] GetFontData(FontProperties fontProperties)
{
string fontFileName = fontProperties.FontFamilyName + ".ttf";
string fontFolder = Environment.GetFolderPath(Environment.SpecialFolder.Fonts);
string targetPath = Path.Combine(fontFolder, fontFileName);
DirectoryInfo directory = new DirectoryInfo(fontFolder);
FileInfo[] fontFiles = directory.GetFiles("*.ttf");
if (fontFiles.Any(s => s.Name.Equals(fontFileName, StringComparison.InvariantCultureIgnoreCase)))
{
using (FileStream fileStream = File.OpenRead(targetPath))
{
using (MemoryStream memoryStream = new MemoryStream())
{
fileStream.CopyTo(memoryStream);
return memoryStream.ToArray();
}
}
}
return null;
}
}
am i missing something?
Thanks in advance for your help!
Hi All,
I have existing docx file which serves as my template. Margins, header and footer and text are all set. Text fields that will be replaced are all in { }. Just wondering how to make it multiple page single docx file with page breaks(pages are based on the number of recipients). There will also be text replacement during process.
Right now the sample I see is creating all text and replacement from codebehind and not coming from an existing docx template ---> https://demos.telerik.com/aspnet-ajax/wordsprocessing/mailmerge/defaultvb.aspx
Any info that can get me started are very much appreciated.
Thanks in advance,
RJ