01.
Private
Sub
InsertText(textBlock
As
Editing.Block, descriptionText
As
String
)
02.
Dim
ascii()
As
Byte
= System.Text.Encoding.ASCII.GetBytes(descriptionText)
03.
For
i
As
Integer
= 0
To
descriptionText.Length - 1
04.
If
ascii(i) = 13
Then
05.
textBlock.InsertLineBreak()
06.
Else
07.
textBlock.InsertText(descriptionText(i))
08.
End
If
09.
Next
10.
End
Sub
Hi all, I'm having trouble locating/seeing the NamedDestinations collection and the Bookmarks collection.
Online documentation indicates both are exposed by the RadFixedDocument object.
I'm using version 2019.2.503.40 of Winforms UI and coding in VB.Net if that matters. All documentation indicates it was available in Q3 of 2018.
Am I missing something obvious or is it not available? I've seen forum posts referencing WPF...
Thanks
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?
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.
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
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
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!
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.
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?