Telerik Forums
Telerik Document Processing Forum
5 answers
1.0K+ views

Hello,

table cell borders set using

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

are missing when using PdfFormatProvider to export a PDF. However, they are present when exporting to DOCX. Please advise. Thanks.

valentino
Top achievements
Rank 1
 answered on 19 Aug 2020
3 answers
1.1K+ views

Hi,

I'm trying to export excel to PDF with letter head on each page of the PDF. how can I achieve it? 

 

Thanks,

Niraja.

Dimitar
Telerik team
 answered on 18 Aug 2020
1 answer
99 views

I am using version 2019.1.215 and I am unable to import anything to fix the missing ScatterSeries classes.

https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/features/charts/series

SeriesGroup scatterSeriesGroup = chart.Chart.SeriesGroups.First() as ScatterSeriesGroup;
ScatterSeries scatterSeries = scatterSeriesGroup.Series.First() as ScatterSeries;
scatterSeries.Marker = new Marker();
scatterSeries.Marker.Symbol = MarkerStyle.Plus;
scatterSeries.Marker.Size = 22;
scatterSeries.Outline.Fill = new SolidFill(Colors.Red);
Martin
Telerik team
 answered on 13 Aug 2020
1 answer
2.5K+ views

I have a .net core 3.1 service application.

My company has bought the DevCraft subscription so I believe this gives me access to the Telerik document Process module.

Which nuget packages do I need to install to be able to load and print a PDF document?

I have found a few posts suggesting 'RadPdfViewer' is the class I need to get access to, but I cannot find a nuget package that allows this to be used in my project.

I found this post:- https://feedback.telerik.com/document-processing/1356074-documentprocessing-printing

But it doesnt compile and I cannot seem to be able to use this code snippet:-

            RadPdfViewer pdfViewer = new RadPdfViewer();
            PdfFormatProvider provider;

            using (MemoryStream memoryStream = new MemoryStream())
            {
                using (Stream stream = File.OpenRead(fileLocation))
                {
                    stream.CopyTo(memoryStream);
                }
                
                provider = new PdfFormatProvider(memoryStream, FormatProviderSettings.ReadOnDemand);
                pdfViewer.Document = provider.Import();

                string fileName = new FileInfo(fileLocation).Name;
                PrintSettings printSettings = new PrintSettings() { DocumentName = fileName };

                pdfViewer.Print(dialog, printSettings);
            }

Would love some assistance on this please, thank you.

Dimitar
Telerik team
 answered on 24 Jul 2020
1 answer
582 views

In one of the application, we are using Telerik Pdf Processing library to convert docx template into pdf. For a few docx templates, exported PDFs are not identical to docx templates.

I've attached both files - template and generated pdf. In the generated pdf, a table is moved into right side and a few portion of right side is cut (Can't see complete table in pdf).

Template: https://drive.google.com/file/d/1u0geoIkSzT3iRAg3xJaSlNsOmC00_078/view?usp=sharing

Generated PDF Output: https://drive.google.com/file/d/1ceNyE4vUxxafaVOZr7zSwDfUm111eu2L/view?usp=sharing

 

Following code, we are using to generate pdf from docx

 

Can anybody tell us what is missing here in code? 

Why a table is cut from right side in the generated pdf? Are there any ways to fix this issue?

 

It would be a great help if anyone could help to fix this issue.

 

[TestMethod]
        public void TelerikPdfConversionTest()
        {
            string templatePath = Path.Combine(_telerikTemplateDirectory, $@"DependentNearing19.docx");
            byte[] data = File.ReadAllBytes(templatePath);
            var provider = new DocxFormatProvider();
            RadFlowDocument doc = provider.Import(data);
 
            string templateName = Path.GetFileNameWithoutExtension(templatePath);
            string pdfPath = Path.Combine(_telerikTemplateDirectory, $@"{templateName}-output.pdf");
            if (File.Exists(pdfPath))
            {
                File.Delete(pdfPath);
            }
            var pdfProvider = new PdfFormatProvider();
            using (Stream output = File.OpenWrite(pdfPath))
            {
                pdfProvider.Export(doc, output);
            }
            Assert.IsTrue(File.Exists(pdfPath));
        }
Martin
Telerik team
 answered on 23 Jul 2020
1 answer
494 views

When I create a `TableCell` in a flow document it is has a left & right padding of ~7.  How can I change the default padding?

I assume styles, right?  https://docs.telerik.com/devtools/document-processing/libraries/radwordsprocessing/concepts/styles

I tried changing the padding but it says there's only a getter: `tableStyle.TableCellProperties.Padding = new Padding(0)`

Dimitar
Telerik team
 answered on 22 Jul 2020
2 answers
547 views

I'm creating a Pdf document several pages long with several tables of varying heights. All of the tables are small enough to fit on a single page. If I just add the tables one after another, some will be split on more than one page. Is it possible to track the current y position on a page and add a page break if a table would be split onto a new page?

Thanks,

 

Tim

Tim
Top achievements
Rank 3
Iron
Iron
Iron
 answered on 14 Jul 2020
5 answers
532 views

Hi all!

I'm using the latest version of Xamarin.Documents.Fixed from NuGet (2020.2.615) and I'm trying to create a PDF in a Xamarin.Forms application using RadFixedDocument. Everything works fine except I cannot insert the degree symbol in the document.

This is my code:

var valueCell = row.Cells.AddTableCell(); //row is a TableRow
var valueCellBlock = valueCell.Blocks.AddBlock();            
valueCellBlock.InsertText("36 °C");

The resulting document contains the text "36 C", without the ° symbol.

So, how should I pass the degree symbol in order to include it in the document?

Kindest regards.

Martin
Telerik team
 answered on 14 Jul 2020
6 answers
2.1K+ views
Hi support,

I'm trying to set the width to 4 columns in a new spreadsheet but it doesn't work the way I expect.

Here's is the code

01.Workbook workbook = new Workbook();
02.Worksheet worksheet = workbook.Worksheets.Add();
03. 
04.worksheet.Columns[1].SetWidth(new ColumnWidth(8.11, true));
05.worksheet.Columns[2].SetWidth(new ColumnWidth(33.78, true));
06.worksheet.Columns[3].SetWidth(new ColumnWidth(60.67, true));
07.worksheet.Columns[4].SetWidth(new ColumnWidth(7.67, true));
08. 
09.IWorkbookFormatProvider formatProvider = new Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();
10. 
11.using (Stream output = new FileStream(fileName, FileMode.Create))
12.{
13.    formatProvider.Export(workbook, output);
14.}

When I check the size of each column in the exported file this is what I get:

column 1: 0.63 (10 pixels)
column 2: 4.00 (43 pixels)
column 3: 7.89 (78 pixels)
column 4: 0.63 (10 pixels)

and what I need is:

column 1: 8.11  (80 pixels)
column 2: 33.78 (311 pixels)
column 3: 60.67 (553 pixels)
column 4: 7.67  (76 pixels)

You can see the screenshot I attached.

How can I get the exact size I'm specifying?

Thank you,

PD: I'm using version Telerik 2019.1.114.40

Arben
Top achievements
Rank 1
 answered on 08 Jul 2020
8 answers
1.2K+ views

Are you able to open a DOCX and return the text from the document into a string. I need to be able to parse through the string to determine text replacements to be made. I can see methods for replacing text, but not for determining what text a document contains

Regards

Tanya
Telerik team
 answered on 30 Jun 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?