Telerik Forums
Telerik Document Processing Forum
3 answers
1.1K+ views

I'm trying to create a simple two item list, with bullets using the RadFlowDocument and RadFlowDocumentEditor.

Like this:-

  • Item One
  • Item Two

I have to admit it's hard going, as the documentation leaves a lot to be desired (why do none of the examples actually end up creating anything in a document?).

I currently have:-

List list = new List();
 
 newDoc.Lists.Add(list);
 
list.Levels[0].StartIndex = 1;
list.Levels[0].NumberingStyle = NumberingStyle.Bullet;
list.Levels[0].ParagraphProperties.LeftIndent.LocalValue = 24;
 
var line1=  editor.InsertLine("Line One");
line1.Paragraph.ListId = list.Id;
 
var line2=editor.InsertLine("Line Two");
line2.Paragraph.ListId = list.Id;

 

This sort of works, with the two lines being indented, but no bullet character is shown.

This thing should be simple, but isn't.

Boby
Telerik team
 answered on 26 Jun 2018
2 answers
272 views

Hi,

I'm trying to move individual blocks (BlockBase) from one document to another (RadFlowDocument). Unfortunately I get an error saying that the blocks I try to move are still related to their original document. This makes sense, because when creating a new block (both Paragraphs and Tables) you must pass a related document to the constructor. Same goes for all their children like Runs, Breaks, Rows etc.

Therefore my question - how can I copy a BlockBase from one RadFlowDocument to another? Is there a way to change this document relationship to another document?

Thanks in advance

Maks

Maksymilian
Top achievements
Rank 1
 answered on 25 Jun 2018
3 answers
517 views

Hi,

I'm evaluating the Telerik.Windows.Documents API, to replace Aspose.NET in our app, for costs reason.

One of our main need, is to open existing .docx files, and replace all bookmark and formFields in the model, by business values.

I don't find any way to iterate through bookmarks and Fields. The EnumerateChildrenOfType is not usable, as Bookmark didn't inherit from DocumentElementBase.

Aspose allow it with "Document.Range.Bookmarks.Cast<Bookmark>()", can you provide an example or an equivalent ?

Regards,

Romain Lagrange

Tanya
Telerik team
 answered on 22 Jun 2018
4 answers
508 views

Hi,

I have a template that is a Word 2003 format. I have converted the template to docx and inserted some bookmarks in order to have the possibility to use document processing to insert text in the template. The template is provided as is so I can not change that.

I have managed to insert text successfully at the position of the bookmark, but I can not make the list work.

Here is the code I have

private void insertListAt(string bookmarkName, IEnumerable<string> values)
{
    if(values == null || !values.Any())
    {
        return;
    }
    var bookmark = document.EnumerateChildrenOfType<BookmarkRangeStart>().FirstOrDefault(rangeStart => rangeStart.Bookmark.Name == bookmarkName);
    if (bookmark != null)
    {
        editor.MoveToParagraphStart(bookmark.Paragraph);
        foreach(string value in values)
        {
            var line = editor.InsertLine(value);
            line.Paragraph.ListId = list.Id;
            line.Paragraph.ListLevel = 4;
        }
    }
}

but this code does not work.

The values are placed one after the other with no new line between them and the list is not applied to the items

Tanya
Telerik team
 answered on 22 Jun 2018
1 answer
275 views
Hello, I have an Interactive Form which is a single page PDF form that I am attempting to fill in C# code. The Interactive form has a 2 Image fields and 8 text fields to populate. When I grammatically load, the text fields appears as a textbox type object where as Image field is not. Instead it appears as PushButton field. What I am attempting here is to add image in the Image field that program reads as PushButton.  Is there a way to inert Image in to these two fields programmatically? 
Georgi
Telerik team
 answered on 21 Jun 2018
9 answers
491 views
Hi,
.
I need to rotate the text in a table cell while using RadFixedDocument. I have created a table and added the Block in table cell.

table.Rows.AddTableRow().Cells.AddTableCell().Blocks.AddBlock().InsertText("MyTest");

Now i want to rotate this by 90 degree. 

Can you guide me how i can achieve this.

Regards,
Sandeep
Tanya
Telerik team
 answered on 21 Jun 2018
1 answer
170 views

     I have C# collections object data and I want to update excel rows automatically and bind data to the rows 

How can I achieve the above requirement using telerik document spread processing libraries?

Boby
Telerik team
 answered on 12 Jun 2018
2 answers
876 views

Hello,

I am creating a RadFixedDocument from a byte array, and removing a single page.If I save the original byte array to a PDF document the file size is 214 KB, but the files size of the document after removing the first page is 563 KP. Any recommendations on how I can reduce the file size?

Utility.RemovePages(polDocResponse);

public static void RemovePages(PolicyDocument polDocResponse, int numPages = 1)
{
            PdfFormatProvider provider = new PdfFormatProvider();
            RadFixedDocument srcDocument = provider.Import(new MemoryStream(polDocResponse.DocumentValue));

            if (numPages >= srcDocument.Pages.Count)
                throw new ArgumentException(
                    string.Format("Utility.RemovePages: Number of pages to remove {0} is greater than or equal to the number of pages in the document {1}.",
                    numPages.ToString(), srcDocument.Pages.Count.ToString()));

            for (int i = 0; i < numPages; i++)
            {
                srcDocument.Pages.RemoveAt(i);
            }

            polDocResponse.DocumentValue = provider.Export(srcDocument);
}

Tanya
Telerik team
 answered on 06 Jun 2018
3 answers
156 views

 

I was trying to apply MinionPro-Bold to a block  using the followign statement. 

_TABlock.TextProperties.TrySetFont(new System.Windows.Media.FontFamily("MinionPro-Bold"));

 

But the text isnt converting to bold. Is there anything that i am missing here. 

 

Regards,

JP

Deyan
Telerik team
 answered on 29 May 2018
1 answer
149 views

I'm wondering if I purchased a global certificate for the Digital Signature feature and followed the example below, will the digital certificate show to be valid when opening in Adobe Acrobat.  I'm currently using a certificate I've created through Adobe which comes back valid on my machine but not on others since it's not been stored in the Adobe store on the other machines.  

 

https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/features/digital-signature

Georgi
Telerik team
 answered on 22 May 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?