Telerik Forums
Telerik Document Processing Forum
0 answers
261 views

Hello

I'm trying to create an Excel xlsx spreadsheet from data in a data table. I'm having trouble setting / defining cell borders. I would like to define a bottom black thin border for a range of cells.

I'm using this as a reference https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/working-with-cells/get-set-clear-properties#borders-property

I've started with this...

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets.Add();

ThemableColor black = new ThemableColor(Color.FromArgb(0, 0, 0, 0));
CellBorders blackBorders = new CellBorders(new CellBorder(CellBorderStyle.Thin, black));
worksheet.Cells[4, 0, 4, 9].SetBorders(blackBorders);

In Visual Studio, ThemableColor and Color are underlined in red. When I mouse over it says 'The name 'Color' does not exist in the current context'.

Am I missing a reference or using statement to be able to use ThemableColor?

Andrew
Top achievements
Rank 1
 asked on 30 Jan 2024
0 answers
150 views
I recently began my 30 day trial with Telerik and I downloaded the Progress® Telerik® UI for ASP.NET Core product.  I am attempting to now add the necessary nuget packages within the Telerik Document Processing product.  When attempting to add the Telerik.Windows.Documents.Core nuget package via the command line, I receive the below error.  I am using a mac with visual studio code for what it is worth.  Any insight on how to work around this error is appreciated.

error: There are no versions available for the package 'Telerik.Windows.Documents.Core'.

Adam
Top achievements
Rank 1
 asked on 03 Jan 2024
1 answer
256 views

My C# project targets net6.0-windows and enables windows forms:

<PropertyGroup>
 <TargetFramework>net6.0-windows</TargetFramework>
 <ImplicitUsings>enable</ImplicitUsings>
<UseWindowsForms>true</UseWindowsForms>
 <Nullable>enable</Nullable>
 </PropertyGroup>

In the code, I want to create PDF documents dynamically and show them by using the PdfViewer component.

Thus, I added the following references:

<PackageReference Include="Telerik.Documents.Core" Version="2023.3.1106" />
<PackageReference Include="Telerik.Documents.Fixed" Version="2023.3.1106" />
<PackageReference Include="Telerik.Documents.Flow" Version="2023.3.1106" />
<PackageReference Include="Telerik.Documents.Flow.FormatProviders.Pdf" Version="2023.3.1106" />
<PackageReference Include="Telerik.Zip" Version="2023.3.1106" />
<PackageReference Include="UI.for.WinForms.AllControls.Net60" Version="2023.3.1114" />

Here is a part of my code:


    internal class GenericPdfCombiner : IPdfCombiner
    {
        public RadFixedDocument Combine(List<string> fileNames)
        {
            using MemoryStream stream = new MemoryStream();
            using (PdfStreamWriter fileWriter = new PdfStreamWriter(stream, leaveStreamOpen: true))
            {
                for (var fi = 0; fi < fileNames.Count; fi++)
                {
                    var file = fileNames[fi];
                    using PdfFileSource fileSource = new PdfFileSource(new MemoryStream(File.ReadAllBytes(file)));
                    for (var p = 0; p < fileSource.Pages.Length; p++)
                    {
                        PdfPageSource sourcePage = fileSource.Pages[p];
                        using PdfPageStreamWriter resultPage = fileWriter.BeginPage(sourcePage.Size);
                        resultPage.WriteContent(sourcePage);
                    }
                }
            }
            PdfFormatProvider provider = new PdfFormatProvider();
            return provider.Import(stream);
        }
    }

but it shows the error Reference to type 'Size' claims it is defined in 'WindowsBase', but it could not be found on the lines like the following:

using PdfPageStreamWriter resultPage = fileWriter.BeginPage(sourcePage.Size);

How can I fix it?

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 03 Jan 2024
1 answer
134 views
why exporting to csv file not loads correctly and how to solve this 
Ramya
Top achievements
Rank 1
 updated question on 27 Dec 2023
1 answer
99 views

Hi,

I would like to create a new style with the All Caps Font Effect enabled in my Word document (refer to the attached image).

How can I do this programmatically?

I was expecting to be able to do it like this, but I cannot find any property to set the All Caps.

var document = new RadFlowDocument();

var style = new Style("ALL_CAPS", StyleType.Paragraph)
{
    Name = "ALL_CAPS",
    BasedOnStyleId = BuiltInStyleNames.NormalStyleId
};

style.CharacterProperties.AllCaps.LocalValue = true;

document.StyleRepository.Add(style);

Thank you

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 22 Dec 2023
1 answer
116 views

Hello,

I am trying to upload the stream object received from the 'ToXlsxStream' method of Telerik SpreadSheet processing library to Azure blob container. Unfortunately, it is saving as a blank excel file. I have data in the List object which is getting converted to xlsx stream. Not sure why the excel file is blank. Tried to save the stream to my local file explorer as well. Still, the issue persists. 

Below is the code:

 

  try
   {
Stream exportStream = exportFormat == SpreadDocumentFormat.Xlsx ? workOrderList.ToXlsxStream(columnsData, (string)options.title.ToString(), cellStyleAction: cellStyle) : workOrderList.ToCsvStream(columnsData);

Task.Factory.StartNew(() => AzureHelper.UploadReportOnCloud(exportStream,fileName, ConfigurationManager.AppSettings[Constant.REPORTATTACHMENTCONTAINER]));

}

            catch(Exception ex)
            {

            }

 

Please help me to resolve this issue.  

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 18 Dec 2023
1 answer
89 views
Please help with adding some text into run with substring numbers (chemical formula)
How to do this?
Yoan
Telerik team
 answered on 18 Dec 2023
1 answer
130 views

I'm trying to convert a word document to PDF and the images and shapes it contains, along with their text, do not make it into the PDF. Are these not yet supported? 

The attached zip contains the original document and the result of the conversion.

The conversion code is pretty straightforward, basically just

DocxFormatProvider docxProvider = new DocxFormatProvider();
var pdfProvider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();
RadFlowDocument document = null;

using (Stream input = File.OpenRead("WordDocWithGraphics.docx"))
{
    document = docxProvider.Import(input);
}

using (Stream output = File.OpenWrite(("WordDocWithGraphics.pdf"))
{
    pdfProvider.Export(document, output);
}

Yoan
Telerik team
 answered on 18 Dec 2023
1 answer
110 views

I have an HTML code with hyperlinks in the text, this must be converted to rtf and the hyperlinks in the text need to be removed, but I did not find a way to remove the hyperlink/uri.

Is there an example for that?

Vladislav
Telerik team
 updated answer on 13 Dec 2023
1 answer
179 views

I am writing an application that that generates a pdf presentation based on a pdf "template" file.  The template file contains one or more images. The application replaces the images in the template file with other images the user has called out. 

How can I name or "tag" the placeholder images in the template file in order to identify what goes where?   

I thought of using the accessibility/alternative text field of each image but I understand that is not currently accessible via the Telerik library.

Are there other fields I could use to place identifiers assocated with the images?

I want to use Adobe acrobat to edit the template file and add the tags if possible.

Thanks. 

Yoan
Telerik team
 answered on 30 Nov 2023
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?