Telerik Forums
Telerik Document Processing Forum
1 answer
359 views

Hi Telerik,

I saw there is a property to exclude the hidden sheets here and here.

But, when I tried to see it in the code, I didn't find it.

I'm using version 2019.3.1021.

Is it not available on my version?

If yes, is there any workaround?

Thank you.

 

Svilen
Telerik team
 answered on 14 Mar 2022
1 answer
487 views

Hi

Is there a way to get the un rounded .Net double value of a formula cell?

Instead of using the GetResultValueAsString method used in the examples:

 

Workbook workbook = new Workbook(); 
Worksheet worksheet = workbook.Worksheets.Add(); 
worksheet.Cells[0, 0].SetValue("=SUM(A2, 3)"); 
worksheet.Cells[1, 0].SetValue(10); 
ICellValue cellValue = worksheet.Cells[0, 0].GetValue().Value; 
CellValueFormat format = worksheet.Cells[0, 0].GetFormat().Value; 
 
string valueAsString = cellValue.GetValueAsString(format); // =SUM(A2, 3) 
string resultValue = cellValue.GetResultValueAsString(format); // 13 
Dimitar
Telerik team
 answered on 03 Mar 2022
1 answer
159 views

Hi,

Which is the better way of getting the 'as displayed' cell value?


Dim selection As CellSelection = worksheet.Cells(i, j)
Dim value As ICellValue = selection.GetValue().Value
Dim format As CellValueFormat = selection.GetFormat().Value
Dim formatResult As CellValueFormatResult = format.GetFormatResult(value)
Dim result As String 

result = value.GetResultValueAsString(format)
'vs.
result =  formatResult.VisibleInfosText   

             

Thanks,

Sid

Tanya
Telerik team
 answered on 02 Mar 2022
1 answer
110 views

Hi,

I like to use the PageSetup in RadSpreadstreamProcessing. I have an generated Excel File and I would like to set Papersize and other configurations. When I integrate it in my Code the IPageSetupExporter is not known.

using (IWorkbookExporter workbookExporter = SpreadExporter.CreateWorkbookExporter(format, documentStream))
            {
                using (IWorksheetExporter worksheetExporter = workbookExporter.CreateWorksheetExporter(nameWorksheet))
                {

                 ..........

               using (IPageSetupExporter pageSetupExporter = worksheetExporter.CreatePageSetupExporter())
                        {

                        ..................

                        }

               }

           }

I get also the message that the IWorksheetExporter doesn't include a definition "CreatePageSetupExporter"?

Has anyone an example how to use this?

Regards

John

Svilen
Telerik team
 answered on 02 Mar 2022
1 answer
186 views
I am able to modify the field correctly and get them to have the correct value. When I export/save the file the form textboxes are all rotated vertically and the only fix I have been able to do is to modify the rotation of the field text in another editor. This kind of ruins the idea of code filling the pdf forms and automating the process. PDFFormatProvider / Telerik Document Processing library is 2022.1.106. I tried rotating the field after value edit to 0,90,etc...and they have all resulted in the similar issue.
johnbolt
Top achievements
Rank 2
Iron
Iron
 answered on 24 Feb 2022
3 answers
271 views

Hello,

many problemes with this code :

 PdfFormatProvider provider = new PdfFormatProvider();
            RadFixedDocument document = provider.Import(File.ReadAllBytes(InputFileWithInteractiveForms6));

 

with pdf exemple of telerik (InteractiveForms.pdf) it is ok.

with pdf issues of Excel or Word on my pc (save as .pdf) it is ok.

 

but with pdf issues of Nuance Software.

sometime, i have this error : Object reference not set to an instance of an object

sometime : Unable to cast object of type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Elements.DocumentStructure.PdfResource' to type 'Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Model.Types.PdfDictionary

 

the properties of my file are :

 

can you help me ?

thank you

eric

 


 

Eric
Top achievements
Rank 1
Iron
 answered on 23 Feb 2022
1 answer
572 views

Hi there,

What is the easiest way to change the font weight of a text? 

Thank you.

Svilen
Telerik team
 answered on 17 Feb 2022
1 answer
605 views

I've been scouring the docs, but I can't find anything.

I have to fall back to using a Syncfusion PDF, but I want to remove that dependency.

Svilen
Telerik team
 answered on 17 Feb 2022
10 answers
1.7K+ views

Hi,

Is there any way to convert/rasterize an existing PDF file to JPG file(s) using PDFProcessing library?

Regards

Blas

JeffSM
Top achievements
Rank 2
Iron
Veteran
Iron
 answered on 16 Feb 2022
1 answer
1.3K+ views

As explained in https://www.telerik.com/forums/size-of-pdf-document

RadPdfProcessing does not embed the whole font but instead embeds only the font subset of the used characters which guarantees minimum font size

 

I want to use a docx as a template for PDF,  so from your sample github https://github.com/telerik/document-processing-sdk/tree/master/WordsProcessing/ContentControls

I use Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider.ExportToFixedDocument to create a RadFixedDocument

then use Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider to export to final PDF.

The problem is the docx is using non standard font, so when I embed the font set (normal, italic, bold, italic bold) the final PDF size reached 3MB with just simple text and no image. This PDF is definitely embedding the full font sets, not the subset.

Is this scenario unsupported or bug?

 

I modified your DocumentGenerator.cs in ContentControls_NetStandard project. Must copy the segoeui.ttf and seguili.ttf to the SampleData folder.


 //overwrite this
        private void Save(RadFlowDocument document)
        {
            IFormatProvider<RadFlowDocument> formatProvider = new DocxFormatProvider();

            string path = "CVTemplate.docx";
            using (FileStream stream = File.OpenWrite(path))
            {
                formatProvider.Export(document, stream);
            }

            Console.WriteLine("Document generated.");

            ProcessStartInfo psi = new ProcessStartInfo()
            {
                FileName = path,
                UseShellExecute = true
            };

            Process.Start(psi);

            //modification
            ExportToFixedDocumentPdfFromRadFlowDocumentDocx(document);
        }

        private void ExportToFixedDocumentPdfFromRadFlowDocumentDocx(RadFlowDocument document)
        {
            //handle png image for NetStandard
            Telerik.Windows.Documents.Extensibility.JpegImageConverterBase jpegImageConverter = new Telerik.Documents.ImageUtils.JpegImageConverter();
            Telerik.Windows.Documents.Extensibility.FixedExtensibilityManager.JpegImageConverter = jpegImageConverter;

            using (FileStream stream = File.Create("ExportedToFixedDocumentPdfFromRadFlow_with_embeddedFont.pdf"))
            {
                // Read the font file -- copy these 2 ttf to sample folder
                byte[] fontDataNormal = File.ReadAllBytes($"{SampleDataFolder}segoeui.ttf");
                byte[] fontDataLight = File.ReadAllBytes($"{SampleDataFolder}seguili.ttf");

                // Register the font set 
                Telerik.Documents.Core.Fonts.FontFamily fontFamily = new Telerik.Documents.Core.Fonts.FontFamily("Segoe UI");
                Telerik.Documents.Core.Fonts.FontFamily fontFamily2 = new Telerik.Documents.Core.Fonts.FontFamily("Segoe UI Light");

                Telerik.Windows.Documents.Fixed.Model.Fonts.FontsRepository.RegisterFont(
                    fontFamily,
                    Telerik.Documents.Core.Fonts.FontStyles.Normal,
                    Telerik.Documents.Core.Fonts.FontWeights.Normal, fontDataNormal);
                Telerik.Windows.Documents.Fixed.Model.Fonts.FontsRepository.RegisterFont(
                    fontFamily2,
                    Telerik.Documents.Core.Fonts.FontStyles.Normal,
                    Telerik.Documents.Core.Fonts.FontWeights.Normal, fontDataLight);

                //export the docx RadFlowDocument to RadFixedDocument
                var radFixedDocument = (new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider()).ExportToFixedDocument(document);

                var fixedFormatProvider = new Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.PdfFormatProvider();
                fixedFormatProvider.Export(radFixedDocument, stream);
            }
        }

 

 

 

 

 

Martin
Telerik team
 answered on 15 Feb 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?