I am trying to create a multi-section PDF report and am getting this error when doing the second .InsertTable:
System.ArgumentException: The document element is associated with another parent.
Something like this:
var pdfDocument = new RadFixedDocument()
{
DocumentInfo =
{
Title = packageTitle,
Author = packageRunBy
}
};
pdfDocument.Destinations.AddPageHorizontalFit();
var pdfEditor = new RadFixedDocumentEditor(pdfDocument);
foreach (var report in reports)
{
if (pdfDocument.Pages.Count > 0) pdfEditor.InsertSectionBreak();
var reportTable = new Table();
// Build the Table
pdfEditor.InsertTable(reportTable); // Errors here on the second time around the loop
}
I have been scouring the documentation looking for help on the following:
My scenario is fairly simple. I am creating a Table and inserting it into the RadFixedDocument using ​.InsertTable(MyTable). Now I need to set the PDF to Landscape, reduce the Margins and set some Header / Footer information
Are there any examples of dynamically generating a PDF report that is essentially a formatted table containing data by looping through an object - using this new PdfProcessing control?

Hi, I am new to PDFProcessing, was following the example codes, but could not compile...Error 2 Argument 1: cannot convert from 'Telerik.Windows.Pdf.Documents.Fixed.Model.RadFixedPage' to 'Telerik.Windows.Documents.Fixed.Model.Common.IContentRootElement'
Error 1 The best overloaded method match for 'Telerik.Windows.Documents.Fixed.Model.Editing.FixedContentEditor.FixedContentEditor(Telerik.Windows.Documents.Fixed.Model.Common.IContentRootElement)' has some invalid arguments
I am using version 2015.1.331.40, runtime version v4.0.30319
RadFixedDocument document = new RadFixedDocument();
RadFixedPage page = document.Pages.AddPage();
FixedContentEditor editor = new FixedContentEditor(page);
editor.DrawText("Hello RadPdfProcessing!");
PdfFormatProvider provider = new PdfFormatProvider();
using (Stream output = File.OpenWrite("Hello.pdf"))
{
provider.Export(document, output);
}
When I try the examples to download a pdf from chrome, the pdf displays in the viewer but when I click save icon it tries to save with the page name of:
defaultcs.aspx
How can I get it to save/prompt for save as PDFDocument.pdf?
Marty
I need to save a compressed byte stream in to a database table, the problem is that whenever i open the file, winZip/winRar/windows reports that the archive is corrupt. I've tried setting leavOpen on the ZipArchive (as suggested in some other posts) but it make no difference.
any ideas?
private byte[] Compress(byte[] pData, string pFileName)
{
CompressionSettings lSettings = new LzmaSettings();
using (MemoryStream lMemoryStream = new MemoryStream()) {
using (ZipArchive lArchive = new ZipArchive(lMemoryStream, ZipArchiveMode.Create, false, null)) {
ZipArchiveEntry lAttachment = lArchive.CreateEntry(pFileName, lSettings);
using (var lAttachmentStream = lAttachment.Open()) {
using (var lStreamWriter = new StreamWriter(lAttachmentStream)) {
lStreamWriter.Write(pData);
}
}
}
return lMemoryStream.ToArray();
}
}
The ScaleFactor property of the WorksheetPageSetup class requires a System.Windows.Size of the WindowsBase, Version=4.0.0.0 assembly.
The WindowsBase assembly does not seem to exist in .Net 4
Where can I find this assembly?
Hello. I am trying to set a default height using the following code:
worksheet.DefaultRowHeight = new RowHeight(UnitHelper.PointToDip(13),true);
But it is not working. How can I set it up? Thank you.