Telerik Forums
Telerik Document Processing Forum
1 answer
7 views

I'm using the HTMLFormatProvider to import HTML content into a RadFlowDocument. This content contains inline <svg> XML. When I use a PdfFormatProvider to attempt to export the HTML page as a PDF, the image is blank. Is it possible to export the SVG as part of that PDF when it is not a file but the actual SVG xml in the page?

 


                string htmlContent = task.Result;

                HtmlFormatProvider htmlProvider = new HtmlFormatProvider();
                
                RadFlowDocument document = htmlProvider.Import(htmlContent);
               
                PdfFormatProvider pdfProvider = new PdfFormatProvider();

                Telerik.Windows.Documents.Extensibility.JpegImageConverterBase jpegImageConverter = new JpegImageConverter();
                Telerik.Windows.Documents.Extensibility.FixedExtensibilityManager.JpegImageConverter = jpegImageConverter;
                
                foreach(Section section in document.Sections)
                {
                    section.Rotate(Telerik.Windows.Documents.Model.PageOrientation.Landscape);
                    section.PageMargins = new Telerik.Windows.Documents.Primitives.Padding(10);
                }
                byte[] pdfBytes = pdfProvider.Export(document);

Dimitar
Telerik team
 answered on 15 Sep 2022
0 answers
7 views

Hello,

Using a RadFlowDocument, I must generate dynamic headers for columns of data. There is no template or way to know ahead of time what headers are needed, so we have to recursively extract data and render tables/rows within outer cells, to align the data w/ the proper column. Overall this works fine. However, tables do not, as far as I can tell, stretch to fit the space their cells, so I'm left with these gaps (in blue in first attached image), as the overall height of the main header row is set by the column with the largest/tallest data, in this case the group of columns with the red borders. 

Is there any way to get the inner tables to stretch to fill that available height?

Note: The different color backgrounds and borders in attached image are for debugging purposes

The general structure of Cells/Rows/Tables that I end up with following this recursive build is described in the second attached image. Rows are red, cells are green, and tables are blue. Perhaps there is another way to build the header that I am not considering. 

Thank you

Edit: I solved the problem changing tactics. I queried the list of headers for a maximum depth and created that number of rows. Added the rows to a list and passed the list to the recursive function. Instead of creating a new table for each subcategory, the code now just adds the item to the proper row, index based on the item's depth, and with proper RowSpan and ColumnSpan values, I'm able to get the desired placement. Image added for comparison. 

Jeff
Top achievements
Rank 1
 updated question on 14 Sep 2022
1 answer
11 views

Using Document Processing library in .NET 6 Blazor application.

is Telerik.Windows.Documents cross-platform or only for Windows?

 

 

 

 

Dimitar
Telerik team
 answered on 05 Sep 2022
1 answer
18 views

Hi,

I'm trying to add a PNG image into a PDF file, but it doesn't work. I app crash when I reach the following instructions :

PdfFormatProvider provider = new PdfFormatProvider();
File.WriteAllBytes (path, provider.Export (document));

Adding a JPG image works fine. If I don't add the PNG, It works fine too.

I'm working with Telerik UI for Xamarin. How can I add this PNG ? It's a PNG with transparancy, does it matter ?

Thank you !

 

Dimitar
Telerik team
 answered on 10 Aug 2022
1 answer
23 views
Is there a way to determine if text in a cell has the effect of Strikethrough?
Dimitar
Telerik team
 answered on 01 Aug 2022
1 answer
23 views

I have a large PDF file with a combination of paragraphs and tables and would like to export from PDF to Docx in order to format the tables. Then after formatting the tables, would like to export that back to PDF.

I can manage the code logic for the tables but do not see how to export from PDF to Word or Docx. In addition I do not see how to programmatically go through the PDF components using the Telerik Document Processing API.  Could you please help?

Dimitar
Telerik team
 answered on 22 Jul 2022
1 answer
23 views

Hi,

I have used the below code to get letters bold in creating the pdf .

block.TextProperties.TrySetFont(new FontFamily("Calibri Light (Headings)"), FontStyles.Normal, FontWeights.Bold);

But I am not able to see the result in pdf . Provide me if any solution available. 

I have used the FixedContentEditor in creating the pdf.

            RadFixedDocument radFixedDocument = new RadFixedDocument();
            RadFixedPage page = radFixedDocument.Pages.AddPage();
            FixedContentEditor editor = new FixedContentEditor(page);

Thanks in advance

Svilen
Telerik team
 answered on 20 Jul 2022
1 answer
40 views

 

We are using the PDFFormatProvider and RadFlowDocument to convert the HTML string to PDF file.  We need a sample code to add the watermark image to the PDF file. 

Language : C#:

Please find the attached code

ex pdfProvider.Export(document);

 

Thanks

 

Regards,

Babu Durairaji

Dimitar
Telerik team
 answered on 20 Jul 2022
1 answer
17 views

Hello,

We had a situation with the Telerik packages recently bypassing firewalls of the networking in our environment. Actually our firewall blocks all the calls from outside including Telerik packages. The networking team whitelisted the domain nuget.telerik.com but the demanded packages still remained blocked. After an research we found out that Telerik uses a series of IP's (probably dynamic) and also subdomains for the packages. 

For the moment we have solved the problem because all the requested IP's of the Telerik packages are allowed in our firewall, but I was wondering if the IP's are dynamic and in a moment of time they will change we will be again in the starting point where is needed to create specific security policies for the new IP's.

So my question is:

Does Telerik have a range of IP's and domain/subdomains so we can add them from the beginning in our firewall?

I am not sure if there is another solution or Telerik provide documentation for similar situations.

 

Thank you!

Dimitar
Telerik team
 answered on 08 Jul 2022
0 answers
18 views

Hi,

After upgrading Telerik in a project I haven't visisted in the last 6-8 months, my Document Processing references are suddenly broken in the code.

The references in Nuget seems to be doing fine, but in the class where I build my Document Processing I am suddenly getting a ton of errors with for example; Workbook, CellIndex(), CellBorder, IWorkbookFormatProvider, ImageSource(), FloatingImage, RadHorizontalAlignment, ColumnSelection to name a few.

Do you have any experience with these sudden problems after upgrading? I upgraded via Nuget Package Manager.

Maybe I am missing something, but it it very frustrating when it has been working without problems before upgrading.

Kind regards,

Kirstine

Kirstine
Top achievements
Rank 1
 asked on 30 Jun 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chris
Top achievements
Rank 2
Iron
Johnny
Top achievements
Rank 1
Iron
Iron
Iron
Hakob
Top achievements
Rank 2
Iron
Simos Sigma
Top achievements
Rank 2
Iron
Iron
Iron
lahiru
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Chris
Top achievements
Rank 2
Iron
Johnny
Top achievements
Rank 1
Iron
Iron
Iron
Hakob
Top achievements
Rank 2
Iron
Simos Sigma
Top achievements
Rank 2
Iron
Iron
Iron
lahiru
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?