Telerik Forums
Telerik Document Processing Forum
1 answer
257 views

Hello,

 

I have requirement where user will provide multiple files that may of type (.doc, .docx, .xls, .xls, .jpg, .bmp, .png, .pdf and .txt) so I have to merge all this document into one pdf file and save that pdf file on system.

Problem is with .doc and .xls. I am  not able to import this files.

 

Any suggestion ?

 

Thank You

Karan Bodhani

Tanya
Telerik team
 answered on 10 May 2018
1 answer
420 views

Hi,

We have a requirement where we allow the user to browse a word file.

Then from that word file we fetch all the form fields and display it to the user.

We came across telerik word processor , but even using that we couldn't find a way to achieve our requirement.

The Telerik Word Processor mentions inserting new field using 'FieldInfo' is this Field Info same as the Form Field in word.

We would like to know using Telerik word processor can we read and update the Form Fields of a word document, if not then is there anything else from Telerik that can help us.

 

Any help in this matter would be appreciated.

Thanks

 

 

Tanya
Telerik team
 answered on 08 May 2018
2 answers
234 views

I am Importing a pretty simple Excel file with one date and two time columns (beside some other text and number columns).

I go trough the rows and columns of the used cell range to extract their values. Most of the Date and Time cells got the correct CellValueType number and the correct FormatType and FormatString. Some of them however come with a CellValueType.Text and a Value of "error" or "string". Actually 1 of 60 rows is affected where i can not retrieve the date and one of the two time cell values.

The strange thing here: Creating a Telerik.Web.Spreadsheet.Workbook from the Model.Workbook and adding the worksheet in question to a RadSpreadsheet the RadSpreadSheet will show no problems at all and all the cell formatting also is correct.

Now is there something fishy with the cell.GetValue()? And is there something i can do to hopefully avoid errors like that. Yes, i could just delete the row and add it again and maybe solve the problem for now. But i will keep the file as it is for Science.

Lars
Top achievements
Rank 1
 answered on 02 May 2018
1 answer
1.0K+ views

Hi,

 

Is there an easy way to set the format of a cell to bold, without going to the procedure with styles?

 

Something like selection.Bold()

In Vba we have:

Range("A1").Characters(8, 5).Font.Bold = True

 

Cheers

Geir

 

 

Tanya
Telerik team
 answered on 26 Apr 2018
2 answers
227 views

If I am using this:

public sealed class Document
{
    public Document(string header, string content)
    {
        Heading = header;
        Content = content;
    }
 
    public string Heading { get; set; }
    public string Content { get; set; }
}

 

And this collection

public List<Document> Documents { get; }

And this document Implementation

public void Create(RadFlowDocument document)
{
    var editor = new RadFlowDocumentEditor(document);

 

    foreach (var t in Documents)
    {
        if (t.Content == null || t.Heading == null) continue;
        var section = document.Sections.AddSection();
        section.SectionType = SectionType.Continuous;
        var paragraph = section.Blocks.AddParagraph();
        editor.MoveToParagraphStart(paragraph);
        paragraph.StyleId = BuiltInStyleNames.GetHeadingStyleIdByIndex(1);
        paragraph.Inlines.AddRun(t.Heading).Paragraph.Inlines.AddRun();

        //is it this next line, because I am making a new paragraph?

        section.Blocks.AddParagraph().Inlines.AddRun(t.Content);
    }
}

 

Everything generates great, but if I am in Word, and collapse one of t.Heading... The t.Content does not collapse under it.  How can I add t.Heading that uses the default word style of 1 (Heading 1) and the text under it use Normal and expand and collapse with the Heading? 

Tanya
Telerik team
 answered on 25 Apr 2018
2 answers
235 views

Hello All,

I am inserting certain amount of text into a block which is part of a table cell. , Post to that i am checking the size of the table and if it is over to the size of the page height , i am doing a split on the block. 

During Debug time , i can observe that the block is split properly but when we check the generated PDF file , we are observing the text to be overflowing in first page. Is this some thing that any one can help me. 

Block answerBlock = new Block();

answerBlock.InsertText(Answer);

if (textAreaTable.Measure().Height +  > pageHeight - 120)
{
Size setSize = answerBlock.Measure(new Size(450, pageHeight - (120 )));
Block secondBlock = answerBlock.Split();
var mySize = answerBlock.DesiredSize;
var pendingElements = answerBlock.PendingElements;
answerCell.Blocks.Add(answerBlock);
}

jaipal
Top achievements
Rank 1
 answered on 20 Apr 2018
2 answers
1.1K+ views

Hi folks,

In the code below, how do I set the text colour for text "INVOICE TO" (line 10) to gray? This is using RadFixedDocument.  

The Block object's TextProperties has a HighlightColor property but not a Color property.

As you can see in the code below, the block is inside a cell within a table row within a table.

Thanks for any pointers.

Ken

01.Table addressInfoTable = new Table();
02.addressInfoTable.LayoutType = TableLayoutType.FixedWidth;
03.TableRow infoToRow = addressInfoTable.Rows.AddTableRow();
04.TableCell infoToCell = infoToRow.Cells.AddTableCell();
05.infoToCell.PreferredWidth = 350;
06.Block infoBlock = infoToCell.Blocks.AddBlock();
07.infoBlock.HorizontalAlignment = HorizontalAlignment.Left;
08.//       infoBlock.TextProperties.HighlightColor = new RgbColor(0, 0, 255);
09.//       infoBlock.BackgroundColor = new RgbColor(255, 10, 10);
10.infoBlock.InsertText("INVOICE TO");
11.infoBlock.InsertLineBreak();
12.infoBlock.InsertText(invoice.Payer.FirstName() + " " + invoice.Payer.LastName());
13.infoBlock.InsertLineBreak();
kencox
Top achievements
Rank 1
 answered on 18 Apr 2018
11 answers
1.3K+ views
Hello to all,
I have a DOCX file with a header logo.
I import the file in a RadFlowDocument and edit it with a RadFlowDocumentEditor.
If I save it in a new DOCX everything it is OK.
If I save a PDF (with Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider) the image disappears.

The image in my DOCX is "in line".
So I think I should not convert images to "ImageInline", right?
If so, why have not the class Telerik.Windows.Documents.Model.ImageInline?
My Telerik version is 2016.2.607.

Thank you
Deyan
Telerik team
 answered on 16 Apr 2018
1 answer
248 views

Hello,

I would like to create a few different pdf-layers during pdf export.

Is it possible to create pdf-layers with PdfProcessing?

sample screen below in attachment:

best regards

Pawel

 

Tanya
Telerik team
 answered on 13 Apr 2018
1 answer
348 views

Hi guys,

I'm trying to add an ImageInLine into header (a classical Logo Company).

I would keep aspect ratio of my bitmap, but after export to word, it takes not effects.

I tryed to change PreferRelativeToOriginalResize to true and to false, when I try to open properties of image (into generated word file), I found this propertiy correctly changed.

But if I try to do same approach with LockAspectRatio to true and to false, It's ever false. Why?

This is my code to test.

I attached 4 test bitmap, 2 for PreferRelativeToOriginalResize (correctly results) and 2 for LockAspectRatio (wrong results)

editor.Document.HasDifferentEvenOddPageHeadersFooters = false;
var header = editor.Document.Sections.First().Headers.Add();
 
var image = header.Blocks.AddParagraph().Inlines.AddImageInline();
using (FileStream fs = File.Open(@"Resources\mylogo.jpg", FileMode.Open))
{
    image.Image.ImageSource = new Telerik.Windows.Documents.Media.ImageSource(fs, ".jpg");
    //image.Image.PreferRelativeToOriginalResize = false;
    image.Image.LockAspectRatio = true;
    //image.Image.SetWidth(true, 40);
}
Tanya
Telerik team
 answered on 12 Apr 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?