This is a migrated thread and some comments may be shown as answers.

Missing property of RadFixedPage - PDFProcessing

2 Answers 282 Views
PdfProcessing
This is a migrated thread and some comments may be shown as answers.
Sushanth
Top achievements
Rank 1
Sushanth asked on 30 Nov 2016, 08:12 AM

Hello,

Iam creating a pdf document wherein iam trying to set the size of the RadFixedPage object but the size property is showing as 

page.Size=new System.Windows.Size()

instead of page.Size = new Size();

What am i missing ? Any reference? 

I have already included the below references on my aspx page 

using System.Windows;
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf;
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf.Export;
using Telerik.Windows.Documents.Fixed.Model;
using Telerik.Windows.Documents.Fixed.Model.ColorSpaces;
using Telerik.Windows.Documents.Fixed.Model.Editing;
using Telerik.Windows.Documents.Fixed.Model.Editing.Flow;
using Telerik.Windows.Documents.Fixed.Model.Fonts;
using Telerik.Windows.Documents.Fixed.Model.Graphics;

 

Thanks in Advance

Sushanth.B

2 Answers, 1 is accepted

Sort by
0
Vincent
Top achievements
Rank 1
Iron
Iron
answered on 30 Nov 2016, 09:27 AM

Hi Sushanth,

When i've your problem the only way i found is this method :

Dim A4Format As System.Windows.Size = Model.PaperTypeConverter.ToSize(Model.PaperTypes.A4)
Dim A4P As New System.Windows.Size 'For Landscape mode, must change after new...
A4P.Height = A4Format.Width
A4P.Width = A4Format.Height
 
'... and set it in my sectionproperties page like this
 
Using Editor As Editing.RadFixedDocumentEditor = New Editing.RadFixedDocumentEditor(document)
     With Editor
        .SectionProperties.PageSize = A4P
        .SectionProperties.PageMargins = New Telerik.Windows.Documents.Primitives.Padding(48.768)
...

 

0
Martin Ivanov
Telerik team
answered on 02 Dec 2016, 09:48 AM
Hi Sushanth,

The Size property of the RadFixedPage class is of type System.Windows.Size which is located in the WindowsBase.dll. After referencing the assembly. You have two options to create a new Size object:
  • Define a "using" directive pointing to the System.Windows namespace:
    using System.Windows;
    And create the Size object like this:
    page.Size = new Size();
  • Or you can create the Size object by using its namespace inline.

    page.Size = new System.Windows.Size();
I hope this helps.

Regards,
Martin
Telerik by Progress

Tags
PdfProcessing
Asked by
Sushanth
Top achievements
Rank 1
Answers by
Vincent
Top achievements
Rank 1
Iron
Iron
Martin Ivanov
Telerik team
Share this question
or