Telerik Forums
Telerik Document Processing Forum
1 answer
130 views

Hello.
I faced several problems with the attribute "text-align: justify".
1) In the report I have a table that displays some note. This note is retrieved from the database as a string with html-markup (with all necessary tags and its different attributes). All properties of the attribute "Style" work as expected except "text-align: justify". As a result in HTML-viewer I have the note (s.attached overwritten1.png). The text somehow is overlapped/owerwritten. In PDF it looks good though (s.attached overwritten1_PDF.png). In the Sdandalone Report Designer (Preview mode) it works correctly. Unfortunately I can't reproduce the issue with demo example and CSV datasource, but when the report runs and retrieves justified note from the database the issue occurs each time.

2) Another problem is with justifying of the bold-text (s.attached bold.png): I tried to reproduce it in the example (s.attached zip-archive).
When the text has bold font-weight (using <strong>-tag) it is not justified even in Designer (Preview mode).  In PDF it is also absolutely incorrect: with left-alignment text doesn't match the table size at all, with justify-alignment  -  text is overlapped and overwritten

3) I have the report title: bold (s.attached bold.png), text-align: center
In both in HTML-viewer and PDF the title is cut. Without bold font-weight it is wrapped correctly. But I can't remove it. I need this formatting.

Looking forward to your help in these matters. 

Best regards,
Elena

Dimitar
Telerik team
 answered on 22 Nov 2022
1 answer
135 views

I am trying to import HTML but when I try to export the radflowdocument it is blank .  (i've exported to both HTML and PDF)

this is in blazor WASM.


Thanks
Phil

Maria
Telerik team
 answered on 18 Nov 2022
1 answer
228 views

I'm using Telerik.Documents.Spreadsheet (2022.3.1108) .Net C# 6.0.  I have my excel spreadsheet formated as I want (Excel.png).  The text in the cells are clearly visible.  Once the same spreadsheet is export using PdfFormatProvider.  The last half a character is trimmed (not visible). (Pdf.png).  While creating the excel file I do have "AutoFitWidth()" set for all the columns.

 

Export Code here


        public void CreatePdf(Workbook wb, string fileName)
        {
            var fixedProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.Pdf.PdfFormatProvider();
            RadFixedDocument fixedDocument = fixedProvider.ExportToFixedDocument(wb);
                        

            var pdfFormatProvider = new Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider();
            pdfFormatProvider.ExportSettings.ShouldEmbedFonts = true;

             using (Stream output = File.OpenWrite($"c:\\temp\\{fileName}.pdf"))
            {
                pdfFormatProvider.Export(fixedDocument, output);
            }
        }

Nikolay Demirev
Telerik team
 answered on 10 Nov 2022
1 answer
216 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
170 views

Hello All,

I am using the RadSpreadStreamProcessing to export data to an Excel spreadsheet and I would like to know how to declare the column headers in the exported spreadsheet as Sortable/Filterable?  Is there an example that I can be pointed to?

Thanks for any help you can provide.

W

Tanya
Telerik team
 answered on 01 Nov 2022
3 answers
128 views

Hi all I have a problem during the import of an existing excel file with formula inside

(e.c.  IF(H1<>"";IF(J1="";"";INDEX(INDIRECT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE("Var_"&C1&"_"&G1&"_"&H1;" ";"hex20");"-";"hex2d");"(";"hex28");")";"hex29");"/";"hex2f");"+";"hex2b");"&";"hex26");".";"hex2e")&"_Daily");MATCH(J1;INDIRECT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE("Var_"&C1&"_"&G1&"_"&H1;" ";"hex20");"-";"hex2d");"(";"hex28");")";"hex29");"/";"hex2f");"+";"hex2b");"&";"hex26");".";"hex2e")&"_Levels");0)));""

or

==EOMONTH(startdate;-1)

These formula are used in different cells in different sheets and when I try to bind the generated json to a spreadsheet component I received this error: 

  • {message: 'Expected op «,» but found sym «Var_» (input: _matr…"hex2b");"&";"hex26");".";"hex2e")&"_Service")"))', pos: 139}
    1. message: "Expected op «,» but found sym «Var_» (input: _matrix(\"INDIRECT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(\"Var_\"&C1;\" \";\"hex20\");\"-\";\"hex2d\");\"(\";\"hex28\");\")\";\"hex29\");\"/\";\"hex2f\");\"+\";\"hex2b\");\"&\";\"hex26\");\".\";\"hex2e\")&\"_Service\")\"))"
    2. pos: 139
    3. [[Prototype]]: H

     

    As posted in some forum  It seems due  to the culture used during excel generation (I tried different approach: attached a different culture to the current thread server side, force kendo core library to use a specific culture client side, force spreadsheet to use a specific culture server side).

    How can I resolved this issue?

    I did not found any working solution on line.

    Thank you in advanced

    Eleonora

Eleonora
Top achievements
Rank 1
Iron
 answered on 27 Oct 2022
1 answer
100 views

Hi Telerik.

Attempting to create a Header with your documentation. Link: Headers and Footers

The example code writes: 

RadFlowDocument document = new RadFlowDocument(); 
document.Sections.AddSection(); 
 
document.Sections.First().Headers.Add(); // Creates the default Header. 
document.Sections.First().Headers.Add(HeaderFooterType.First); 
document.Sections.First().Headers.Add(HeaderFooterType.Even); 

However I get the errorcode:


'object' does not contain a definition for'Headers'and no accessible extension method 'Headers' accepting a first argument of type
 'object'could be found (are you missing a using directive or an assembly reference?) 

Am I doing something wrong?

 

 

Steffen
Top achievements
Rank 1
Iron
 updated answer on 27 Oct 2022
1 answer
138 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
1 answer
122 views

I'm doing a recursive file search through a lot of documents (1000000+) for a client, depending on the document type/age/size/name/path the app may read the document.

this is the read code

Dim docprovider As New Doc.DocFormatProvider()
		Using input As Stream = File.OpenRead(_fname)
			Dim TxtFormatProvider As New TxtFormatProvider
			text = TxtFormatProvider.Export(docprovider.Import(input))
		End Using

Occasionally the app will hang waiting for the

TxtFormatProvider.Export(docprovider.Import(input))

Thread to return.

I'm guessing the input stream of the .doc file is malformed in someway, and I'm not really concerned about it, but how can I get the thread to quit so the app can go to the next file?

Dimitar
Telerik team
 answered on 20 Oct 2022
1 answer
200 views

Hello,

we are currently in need for a docx to pdf converter.

The docx file contains placeholders created in word. When we want to read it in with the Telerik documents package it gives us an error. 

The Import() function returns:

Error: System.ArgumentException: 'An item with the same key has already been added. Key: 0'

Here is the code we are using:

        static void ConverDocxToPdf(string path, string resultPath)
        {
            var docxPRovider = new Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider();
            var pdfProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();

            byte[] docBytes = File.ReadAllBytes(path);
            var document = docxPRovider.Import(docBytes);

            var resultBytes = pdfProvider.Export(document);
            File.WriteAllBytes(resultPath, resultBytes);
        }

 

I attached one of the templates we are using. When you try to read it in, it will return the mentioned error.

 

Thank you in advance!

 

Dimitar
Telerik team
 answered on 19 Oct 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?