Telerik Forums
Telerik Document Processing Forum
1 answer
30 views

Hi - I'm trying to open accessible Word document (with stuff like tags, alternative text on images, etc.), but when I'm saving in to PDF all of that is gone. Looking at this: https://docs.telerik.com/devtools/document-processing/libraries/radpdfprocessing/howto/comply-with-pdfa-standard I've tried to set `ComplianceLevel` but nothing has changed, pdf is inaccessbile. Should I set something additional? Is this supported?

Version I'm using is: 2023.1.104, platform is .NET 7

I've attached the code that I'm running and the template that I'm working on.

Dimitar
Telerik team
 answered on 26 May 2023
0 answers
56 views

Hi there,

 

I need to create a pdf with various different tabs. So, I work with RadPdfProcessing.

In order to create a next page when there is no more place on the current page, I set a method that measures the available size on the page (without margin) and the size of the object to draw, before drawing it. If there is enough space, I draw it on current page, if not, I create a new page and draw it on.
But when I run my code, some tables are drawn in the margin of my page, as you can see on attached pictures.
I don't understant why. And when debugging, measures are working fine...
Could someone explain me what I'm missing or doing wrong please?

Here is my code :

Code about measuring object and page creation

        public static readonly Size _pageSize = new(Unit.MmToDip(210), Unit.MmToDip(297));
        public static readonly Thickness _margins = new(Unit.MmToDip(15));

        public static DocumentContainer CreateNewPage(RadFixedDocument document)
        {
            var page = document.Pages.AddPage();
            var editor = new DocumentContainer(page, _pageSize, new Padding(_margins.Top, _margins.Right, _margins.Bottom, _margins.Left));
            //if not first page, position the editor between margins 
            if(document.Pages.Count != 1) 
                editor.Position.Translate(_margins.Left, _margins.Top);
            return editor;
        }

        public static DocumentContainer CheckRemainingSpaceAndCreateNewPageIfNeeded(IBlockElement elementToDraw, DocumentContainer editor, RadFixedDocument document)
        {
            var remainingHeight = editor.PageHeight - _margins.Bottom  - editor.Position.Matrix.OffsetY;
            var neededSize = elementToDraw.Measure(new Size(editor.PageInternWidth, editor.PageInternHeight));

            if(remainingHeight < neededSize.Height)
            {
                return CreateNewPage(document);
            }

            return editor;
        }

 

Code about table creation

        public static Table CreateTable(BorderStyle borderStyle = BorderStyle.None)
        {
            return new Table
            {
                Borders = new TableBorders(new Border(borderStyle)),
                LayoutType = TableLayoutType.FixedWidth,
            };
        }

And the code about table drawing


        private Table DrawOneStyleTable(...)
        {
            var oneCellPadding = new Thickness(Unit.MmToDip(5));
            var anotherCellPadding = new Thickness(Unit.MmToDip(5), Unit.MmToDip(2), Unit.MmToDip(5), Unit.MmToDip(2));

            //Add table
            Table table = Helper.CreateTable();
            table.DefaultCellProperties.Padding = new Thickness(5);

            table.Borders = new TableBorders(new Border(2, BorderStyle.Single, mycolor));

            //Add rows

            _editor = Helper.CheckRemainingSpaceAndCreateNewPageIfNeeded(table, _editor, _document);
            _editor.DrawTable(table, _editor.PageInternWidth);
            return table;
        }

        private Table DrawSecondStyleTable(...)
        {
            //Add table and row
            Table table = Helper.CreateTable();
            //Add content

            _editor = Helper.CheckRemainingSpaceAndCreateNewPageIfNeeded(table, _editor, _document);
            _editor.DrawTable(table, _editor.PageInternWidth);
            return table;
        }

 

Please do not hesitate to ask me more information if needed.

 

Thank you in advance for your help,
Regards,
Adrian

Adrian
Top achievements
Rank 1
Iron
 asked on 25 May 2023
2 answers
46 views

Hi all,

 

I need to create some profile cards on a document based on the style template attached here. At the end of the process, the document should be exported in pdf.

I have tried a lot of things with RadWordsProcessing and RadPdfProcessing but I'm not sure I would be able to obtain the exact same result because of style limitations like rounded corners unavailable, for example.

Does anybody have any idea how I could create something the most similar possible? With any Telerik Document Processing tool.

I also tried to make a table (structured as in attached picture) but I didn't succeed to create the table with a colored background or image background (on all the table) and with the profile picture which should be place in a circle shape, ahead the table background. 

As I'm new to Telerik, my knowledge is limited, but I didn't find any information that helps me.  On the contrary, I only found information that make me doubt about the feasibility of this project.

 

Any help would really be appreciated,

Thank you in advance,

Adrian

 

Adrian
Top achievements
Rank 1
Iron
 answered on 15 May 2023
4 answers
554 views

Hello,

I have a problem. I want to create a table which should be right-aligned.

But when I try to set table.Alignment to Right It does not work.

I export this document into PDF.

 

Here is a sample code and the result screenshot.

 

1.RadFlowDocument document = new RadFlowDocument();
2.Table table = document.Sections.First().Blocks.AddTable();
3.table.Alignment = Alignment.Right;
4.TableRow row = table.Rows.AddTableRow();
5.TableCell cell = row.Cells.AddTableCell();
6.cell.Blocks.AddParagraph().Inlines.AddRun("sample text");
Richard
Top achievements
Rank 1
Iron
 answered on 12 May 2023
0 answers
44 views

I encountered this error in console when the application is initially rendered or run. We are using telerik UI for blazor.  Never encountered with this issue before, do anyone have any idea why this error is occurred and any possible solutions to it?

 

Anup
Top achievements
Rank 1
 updated question on 11 May 2023
1 answer
114 views

Hi all,

 

I'm trying to import a word document as template, and change some text from this document with RadWordsProcessing in order to fill this document automatically.

In order to do that, I assume I must import the document as a RadFlowDocument and then change some text with the Replace method and finally export the modified document. But, when I import the word document and export it without any change, all text in text boxes or in shapes has disappeared. Is there any step or any configuration I missed?

Here is my code :

    RadFlowDocument document;
    DocxFormatProvider provider = new DocxFormatProvider();
    using (Stream input = File.OpenRead(myTemplateFilePath)
    {
        document = provider.Import(input);
    }

    //Change my text here with replace method
    //RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document); 
    //editor.ReplaceText("oldText",  "newText");

    IFormatProvider<RadFlowDocument> formatProvider = new DocxFormatProvider();
    using (FileStream stream = File.OpenWrite(myResultFilePath))
    {
        formatProvider.Export(document, stream);
    }

    Console.WriteLine("Document generated.");

 

Pictures of my template file and my result file are attached here.

 

Thank you in advance for your help,
Regards,

Adrian

Aleks
Telerik team
 answered on 05 May 2023
1 answer
56 views

Hi,

We would like to know if we can add extra fields to a signed pdf document without invalidating the signatures and also if we open the pdf to be able to trace the addons.  

Please see the attached image.

If possible provide us  sample code how we can achieve that in case your library has this functionality

thanks

john

Yoan
Telerik team
 answered on 05 May 2023
1 answer
87 views

Hi,

I have some issues converting doc or docx files to pdf.

Attachment has the code sample and 2 documents.

Problem_with_footer.docx after transformation does not render bold chars and does not display footer at all..

Changes_Signature_position.doc after transformation the position of Signature place is not correct.

 

Any  help would be appreciated

Thanks

John

Yoan
Telerik team
 answered on 04 May 2023
1 answer
75 views

I need to rotate the text vertically.

It seems the TextRotation is unavailable when using Telerik.Documents.SpreadsheetStreaming.SpreadCellStyle.

How do I apply text rotation to a style using SpreadsheetStreaming?

 

Thanks,

 

Jim

Anna
Telerik team
 answered on 28 Apr 2023
1 answer
85 views

Hello

We have an existing extensive report created with a RadFixedDocument for saving as pdf. We would like to allow users to add content from multiple TelerikEditors to the report, as comments. The TelerikEditor exports html. I have seen this post: https://www.telerik.com/forums/telerik-blazor-pdf-processing---tutorial-on-how-to-add-markup-html-in-a-string-to-a-pdf

Is there any other way to add HTML snippets in a PDF report, or should we rewrite the entire report as a RadFlowDocument?  Is there an other way to convert some basic HTML to elements we can use on Block.

Thanks

  -Edo

 

Edo
Top achievements
Rank 1
 updated question on 26 Apr 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?