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 there,
I am using the trial version at the moment to see if Telerik's document processing can replace another library we are currently using.
Here is our scenario,
We have a Word template document that has merge fields already setup and tables with borders already setup. This word template is read from a database table column into a memory stream and then we use the DocxFormatProvider to import the document to the RadFlowDocument. Below you can see a piece of the template document already setup.
When using EnumerateChildrenOfType<Table>().ElementAt(1) for example I can see that the table is selected and I can see that the border values have been picked up from the word template document. Below inspecting object for the table selected from the template document.
We then perform our mail merge and then use PdfFormatProvider to convert the merge result into a PDF document. The result is that the mail merge fields are merged correctly but all the tables have lost there borders that the original word template document had.
I have tried to after using EnumerateChildrenOfType<Table>().ElementAt(1) to set the border again manually with new TableBorders(new Border(2, Telerik.Windows.Documents.Flow.Model.Styles.BorderStyle.Dotted, new ThemableColor(Colors.Black))); This also does not work.
Here is the PDF result produced, any suggestions would be appreciated. (Also a note, even if I take out mail merge in the process, the document converting straight from Word Template to PDF still produces the tables with no borders...)
Another note when I use your demo link and load my template and export to PDF the borders are also missing. (Telerik Export to PDF)
I want to import pdf document to a RadFlowWordDocument in the current Run from code.
Is it possible? I have imported pdf using RadEditor.
Basically i am trivarsing whole word document template and updating the text of merge field run.
But after updating the text i want to delete the merge field. How to do that?
var currentDocument = document.EnumerateChildrenOfType<DocumentElementBase>().ToList();
int indexElement = 0;
foreach (var currentElement in currentDocument)
{
if (currentElement.GetType() == typeof(Run))
{
currentRun = (Run)currentElement;
if (currentRun.Text.StartsWith("«") && currentRun.Text.Length > 2)
{
string runText= currentRun.Text.Substring(1, currentRun.Text.Length - 2);
if(runText == "name")
currentRun.Text = "faraz";
}
Now after updating the text i want to delete the merge field and maintain the run text. How to do that?
I'm using RadFlowDocument editor to insert a document in a specific position after a text from run.
So flow is read a document runs and when a text is reach insert another RawFlowDocument in it.
But the problem is always adding it in the end.
I want to insert it at specific position.
There are total 3 documents that needs to be added at specific position.
The run text shows i am at the right position but the generated document always shows new document in the end.
I'm using RadFlowDocument to edit a document (docx), this file is a combination of different docx file.
I have to add Table of content in this file. I saw this code but it is using RadDocument instead of RadFlowDocument class
RadDocument document = new RadDocument(); RadDocumentEditor editor = new RadDocumentEditor(new RadDocument()); editor.InsertField(new TableOfContentsField(), FieldDisplayMode.Result);
How can I add ToC using RadFlowDocument ?
Thanks
Hi
I am working on code to read DOCX from user, then I will replace text in DOCX by our data.
Anyway, I want to validate all font that is used by uploaded document. Can you provide me code snippet?
I have debugged Run, StyleRepository, Paragrah but no luck. it just display default Verdana.
When I convert a document from .docx to .PDF, the footer disappears. There are a couple checkboxes in the docx that disappear as well. Does this library support these things? Is there something specific I have to do to make them work?
My code:
RadFlowDocument document; Telerik.Documents.ImageUtils.ImagePropertiesResolver defaultImagePropertiesResolver = new Telerik.Documents.ImageUtils.ImagePropertiesResolver(); Telerik.Windows.Documents.Extensibility.FixedExtensibilityManager.ImagePropertiesResolver = defaultImagePropertiesResolver; using (FileStream input = new FileStream("file.bin", FileMode.Create, System.IO.FileAccess.ReadWrite)) { input.Write(doc.Content, 0, doc.Content.Count()); DocxFormatProvider provider = new DocxFormatProvider(); document = provider.Import(input); //insert the data RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document); foreach (var item in templateValues) { editor.ReplaceText(item.Key, item.Value); } //change the value in the footer editor.ReplaceText("[Document Revised Date]", doc.lastModified.ToShortDateString()); PdfFormatProvider pdfProvider = new PdfFormatProvider(); var result = pdfProvider.Export(document); return result;