Hello
The following method is supposed to import a PDF file and export it. It works as expected, except that the image is lost.
private
void
Test1()
{
var provider =
new
PdfFormatProvider();
var stream = File.OpenRead(@
"C:\inputFile.pdf"
);
var document = provider.Import(stream);
using
(var output =
new
FileStream(@
"C:\outputFile.pdf"
, FileMode.OpenOrCreate))
{
provider.Export(document, output);
}
}
You might say that the file is in bad format or something, but why would this work?
private
void
Test2()
{
var stream =
new
FileStream(@
"C:\inputFile.pdf"
, FileMode.Open, FileAccess.Read);
var source =
new
PdfDocumentSource(stream, FormatProviderSettings.ReadOnDemand);
ViewModel.DocumentSource = source;
}
DocumentSource is binded to the PdfViewer.DocumentSource.
Here is the link to the PDF inputFile: https://goo.gl/3lpe9O
Thank you
Hi
How can I clone a RadFixedPage and added to a new RadFixedDocument
I tried with this code but I get an error so I think that I need to clone the page before I can added to another document
RadFixedDocument originalDocument = pdfProcessingProvider.Import(inputPdfStream);
RadFixedDocument newDocument =
new
RadFixedDocument();
foreach
(var page
in
originalDocument.Pages)
{
newDocument.Pages.Add(page);//ERROR!!
}
Thank you
Hello, I need to export / convert an Excel file to Pdf file.
Unfortunately using Microsoft.Interop everything works in development but not in production.
I have been able to use the RadFlowDocument features to convert a Word file to pdf using the following code.
public
void
TransformPdf(
string
fileSource,
string
fileDestination)
{
IFormatProvider<RadFlowDocument> fileFormatProvider =
new
DocxFormatProvider();
using
(FileStream input =
new
FileStream(fileSource, FileMode.Open))
{
RadFlowDocument document = fileFormatProvider.Import(input);
byte
[] renderedBytes =
null
;
IFormatProvider<RadFlowDocument> formatProvider =
new
RtfFormatProvider();
using
(MemoryStream ms =
new
MemoryStream())
{
formatProvider.Export(document, ms);
renderedBytes = ms.ToArray();
File.WriteAllBytes(fileDestination, renderedBytes);
}
}
}
My question is: Do you have a similar or alternative way to make a pdf conversion using the Telerik libraries?
Thank you, Mario
hello i have docx file in memorystream and open in telerik zip.
I see all entries,files how to replaced some files in this zippackage and save to memorystream?
Hi, I wonder if you can help with my issue
How to put text in two columns as shown in the image?
Hello,
I am importing a docx file to a radflowdocument and I need to be able to find some elements (such as list items) and see what the font properties are of text and make adjustments. I can see all of the lists in the document, but can't figure out how to get the associated text/text properties for them. Is this possible?
Thanks!
I'm looking into the possibilities of using Telerik Document Processing instead of Telerik Reporting in order to get some better control over the "widows and orphans" problem that my report in Telerik Reporting has, specifically when table headers appear at the bottom of a page and the data appears at the top of the next, and when a table's footnote (or the last line of a paragraph) appears at the top of a new page by itself, separated from all other data.
I imagine that using a RadFixedDocument could (hypothetically) allow me to control exactly where a paragraph or table breaks across a page, or gets pushed to a new page entirely, but that would be a lot of extra work to implement when I would expect that RadFlowDocument should already be able to do that. The problem is, I haven't found anything in the documentation or online about widow/orphan control in Telerik Document Processing, or even about how or when it determines where to wrap to a new page.
Is there anything built in for this, or can I even see when a page is supposed to break at design-time to prevent stray lines at the top and bottom of pages?
I am currently trying out SpreadProcessing. I am importing an xlsx spreadsheet file using the XlsxFormatProvider, capturing its data into a DataTable and then exporting it (without changes) to a new file (with an xlsx extension).
However, when I subsequently open the exported file in Excel, I get the following message:
We found a problem with some content in <file>. Do you want us to recover as much as we can? If you trust the source of this workbook, click Yes.
If I click Yes, the file appears to load fully and correctly (although I get a further dialog). How can I avoid this message - it's going to be a concern to users of the application I'm intending to use SpreadProcessing in.
Excel Version 2013; Visual Studio 2017; UI for ASP.NET AJAX R2 2017; .NETFramework 4.5.2