Telerik Forums
Telerik Document Processing Forum
1 answer
109 views
It should have the following features using latest version of the documentation:
1)The ability to set margins should be available.
2)The ability to export PDF files should be available.
3)I'd like to incorporate html content in various blocks, as well as one logo and signature.
Yoan
Telerik team
 answered on 07 Mar 2023
0 answers
51 views

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

 

 
alex
Top achievements
Rank 1
 asked on 24 Feb 2023
1 answer
166 views

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)

Vladislav
Telerik team
 answered on 23 Jan 2023
3 answers
195 views

I want to import pdf document to a RadFlowWordDocument in the current Run from code.

Is it possible? I have imported pdf using RadEditor.

 

Maria
Telerik team
 answered on 05 Jan 2023
1 answer
152 views

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?

Yoan
Telerik team
 answered on 29 Dec 2022
1 answer
74 views

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.

else if (currentRun.Text.EndsWith("Template»"))
                                {

                                    string ebrTemplateName = currentRun.Text.Substring(7, currentRun.Text.Length - 8);
                                    var currentT = ModifyTemplate(ebrTemplateName, jsonToken + "[" + i + "].");
                                    if (currentT != null)
                                    {


                                       // documents.Enqueue(new DocumentsStack { document = currentT, run = currentRun });
                                        currentRun.GetEditorBefore().InsertDocument(currentT);
                                         //editor.InsertDocument(currentT);
                                        
                                    }

                                }
Maria
Telerik team
 answered on 23 Dec 2022
4 answers
101 views

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

Muhammad
Top achievements
Rank 1
Iron
 answered on 22 Dec 2022
1 answer
124 views

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.

Yoan
Telerik team
 answered on 06 Dec 2022
1 answer
86 views

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;

Peshito
Telerik team
 answered on 10 Nov 2022
1 answer
82 views
Hello, I would like to convert a Word file (.docx) to a PDF and then display it in the RadPDFViewer.

I have already tested examples here in the forum. However, the PDF file is always empty or corrupt.

Can someone help me there?

The program is written in C#

Thanks in advance
Dimitar
Telerik team
 answered on 25 Oct 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?