Telerik Forums
Telerik Document Processing Forum
1 answer
133 views

Hello!
I'm create xlsx from template, which contains some chart

string path = Path.Combine(Path.GetPathRoot(Environment.SystemDirectory), "Templates", "Charts.xlsx");
using FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Read);
XlsxFormatProvider formatProvider = new XlsxFormatProvider();
 
using Workbook workbook = formatProvider.Import(stream);

 

But workbook doesn't contains any chart objects after importing from stream.
Why?

Dimitar
Telerik team
 answered on 26 Oct 2020
3 answers
150 views

Hello,

I'm trying few options to draw images to RadFixedDocument, by using FixedContentEditor.DrawImage(), RadFixedPage.Content.AddImage(),  by stream, and by image source, in some documents generated PDF is blank, after image added... page has 716x956, position is 333x547, image to be drawed has 150x40px, page margin 50 from all sides.

 

 

Martin
Telerik team
 answered on 12 Oct 2020
4 answers
635 views

I am loading document from array.

In my local solution it work´s fine,  but when i deploy  the website to the server it doesnot work. the error is:

The type initializer for 'Telerik.Windows.Documents.Flow.Model.RadFlowDocument' threw an exception.

 

StackTrace: 
   at Telerik.Windows.Documents.Flow.Model.RadFlowDocument..ctor(Boolean setInitialDocumentDefaultValues)
   at Telerik.Windows.Documents.Flow.FormatProviders.Docx.Import.RadFlowDocumentImportContext.BeginImport()
   at Telerik.Windows.Documents.FormatProviders.OpenXml.OpenXmlImporter`1.Import(Stream input, IOpenXmlImportContext context)
   at Telerik.Windows.Documents.Flow.FormatProviders.Docx.DocxFormatProvider.ImportOverride(Stream input)
   at Telerik.Windows.Documents.Common.FormatProviders.BinaryFormatProviderBase`1.Import(Byte[] input)
   at FlujoTrabajo_VentanaFirma.GeneraOficioParaFirma(Byte[]& DocumentoPDF, Int32 idArchivo, Int32& NumOficio, String CodigoValidacion, Int32& IdFormulario, String Firmante, String PieFirma, DbTransaction transaction) in c:\Users\pmunoz\AppData\Local\Temp\WebSitePublish\Web_SIGEDOC--1718161755\obj\Debug\AspnetCompileMerge\Source\FlujoTrabajo\VentanaFirma.aspx.cs:line 1138

Tanya
Telerik team
 answered on 06 Oct 2020
1 answer
260 views

Hi, 

Please help me to create layout of pdf document page have a lot of table and have layout same as picture in attachment file.

Many thanks

 

Martin
Telerik team
 answered on 30 Sep 2020
3 answers
465 views

Good day,

how is it possible to create the pdf thumbnail images in background without blocking the whole application?

I am generating a list of thumbnails of the 1st page of many PDFS, which results in the application UI beeing blocked.

This is what I am doing:

public ImageSource ConvertPdfToImageThumbnail(string filePath)
        {
            var tf = new ThumbnailFactory();
 
            using Stream stream = File.Open(filePath, FileMode.Open);
            var formatProvider = new PdfFormatProvider();
            RadFixedDocument document = formatProvider.Import(stream);
 
            if (document.Pages.Count > 0)
            {
                ImageSource result = tf.CreateThumbnail(document.Pages[0], document.Pages[0].Size);
                return result;
            }
 
            return null;
        }

 

The function is not doing anything on the UI, just loading a PDF and creating the ImageSource.

When called from a different Thread,  the line

    "ImageSource result = tf.CreateThumbnail(document.Pages[0], document.Pages[0].Size);"

is throwing this error: "the calling thread must be STA ..."

How can this task be done without blocking the UI?

Thank you for your support!

Dimitar
Telerik team
 answered on 30 Sep 2020
6 answers
247 views

When creating a password-protected ZIP archive, if I create a new entry and write to it, and during this process create, write and close a second entry, then the first entry appears to be corrupt when you try to read the file.

For example, the following see the following program:

static void Main(string[] args)
{
    // Create the main ZIP file
    using (var zipStream = File.Create(@"c:\temp\test.zip"))
    {
        var encrypt = new DefaultEncryptionSettings { Password = "nick" };
        using (var zipArchive = new ZipArchive(zipStream, ZipArchiveMode.Create,true,null,null,encrypt))
        {
            // Create the 1st entry.
            using (var entry1 = zipArchive.CreateEntry("text1.txt"))
            {
                using (var stream1 = entry1.Open())
                {
                    using (var writer1 = new StreamWriter(stream1))
                    {
                        writer1.WriteLine("Writer 1 line 1");
                        // While writing the 1st entry, create a second entry
                        using (var entry2 = zipArchive.CreateEntry("text2.txt"))
                        {
                            using (var stream2 = entry2.Open())
                            {
                                using (var writer2 = new StreamWriter(stream2))
                                {
                                    writer2.WriteLine("Writer 2 line 1");
                                }
                            }
                        }
                        // Continue writing the 1st entry.
                        writer1.WriteLine("Writer 1 line 2");
                    }
                }
            }
 
        }
    }
}

 

This runs without error. Opening the file using 7-zip, I can read the "text2.txt" entry with no problem with the correct password. However, opening the "text1.txt" file gives an error suggesting the password is wrong.

Program in .NET 4.6, using Telerik.Windows.Zip 2018.3.1010.40.

Martin
Telerik team
 answered on 29 Sep 2020
2 answers
181 views

I have a large project coming up that will be a combination of ASP.net core and .Net core console applications to generate various types of documents for customer consumption.  I am trying to take this time now to learn how to use the Telerik document libraries.  This page seems to imply that there are specific libraries for .net core https://docs.telerik.com/devtools/document-processing/getting-started/first-steps.

Using nuget, I added Telerik.Documents.Core, Fixed, Flow, Flow.FormatProvideders.PDF to the project..  But when referencing the libraries in the Program.cs using section, it will only autofill Telerik.Documents.Core and Telerik.Zip.  Visual Studio 19 does not recognize.Fixed or .Flow libraries.

If I change to the telerick.windows versions of the libraries, VS does add all the libraries without a problem to the application.  it compiles but when executing, it throws an error as missing libraries.

What am I missing?  Should we only create standard .net console apps & only use the .net core libraries when integrating with asp.net core applications?

Marianne
Top achievements
Rank 1
Iron
Iron
 answered on 22 Sep 2020
3 answers
365 views

Hi!

I am using RadWordsProcessing  and load Word`s file.

RadFlowDocument document;
DocxFormatProvider fileFormatProvider = new DocxFormatProvider();
string fileName = Server.MapPath("./Data/Document.docx");
using (FileStream input = new FileStream(fileName, FileMode.Open))
{
            document = fileFormatProvider.Import(input);
}
RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);

 

Text in the file is written in Times New Roman font.

But when exporting to pdf, the font changes to Segoe UI font.

Why?

 

 

 

 

 

Martin
Telerik team
 answered on 31 Aug 2020
1 answer
78 views

I am using version 2019.1.215.

I am importing an excel file to modify some cell values and exporting it.

The issue is that the exported file is displaying the filter icon for the merged cells.

Is this fixed in the latest versions?

Dimitar
Telerik team
 answered on 20 Aug 2020
3 answers
325 views

Using Telerik UI for Blazor.

Just started experimenting with PDFs, so maybe I just overlooked it.

I can easy draw an image with full opacity, but nowhere in the RadFixedPage or FixedContentEditor settings seems to be anything to set opacity.

Martin
Telerik team
 answered on 19 Aug 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?