pdfviewer1.PrinterSettings.PageSize = PdfViewerPrintSize.Fit;

Dear Sirs,

what kind of datatype is expected in:  pdfviewer1.PrinterSettings.Pagesize ?

I know that PdfViewerPrintSize.Fit return INT32 type, but I got error if I use syntax above ?
The error is Attribute Mismatch in Expression and in log files I found: Unable to cast object of type 'Syncfusion.Windows.PdfViewer.PdfViewerPrinterSettings' to type 'System.Type'.


I am not using Visual Studio C#, but Magic XPA v3.xx 

Thanks and best regards.

6 Replies

PE Priyanga Elangovan Syncfusion Team March 9, 2018 01:44 PM UTC

Hi Vili,

Thank you for contacting Syncfusion support.

The API “pdfViewerControl1.PrinterSettings.PageSize” accepts “Syncfusion.Windows.PdfViewer.PdfViewerPrintSize” type values and we are unable to reproduce the type casting error while using the following code in PdfViewer Windows forms.
 
pdfViewerControl1.PrinterSettings.PageSize= Syncfusion.Windows.PdfViewer.PdfViewerPrintSize.Fit; 

We have prepared the sample for your reference. Please find the sample from below link.
http://www.syncfusion.com/downloads/support/forum/136305/ze/Sample-1204000160.zip

Kindly provide the following details to reproduce the issue at our end.
 
  • Simple sample along with the input document
  • Operation System:
  • .Net Framework:
  • Syncfusion Essential Studio Version:
  • RAM:
  • System Culture Information:

Regards,
Priyanga.E
 



PE Priyanga Elangovan Syncfusion Team March 9, 2018 01:45 PM UTC

Hi Vili,

Thank you for contacting Syncfusion support.

The API “pdfViewerControl1.PrinterSettings.PageSize” accepts “Syncfusion.Windows.PdfViewer.PdfViewerPrintSize” type values and we are unable to reproduce the type casting error while using the following code in PdfViewer Windows forms.
 
pdfViewerControl1.PrinterSettings.PageSize= Syncfusion.Windows.PdfViewer.PdfViewerPrintSize.Fit; 

We have prepared the sample for your reference. Please find the sample from below link.
http://www.syncfusion.com/downloads/support/forum/136305/ze/Sample-1204000160.zip

Kindly provide the following details to reproduce the issue at our end.
 
  • Simple sample along with the input document
  • Operation System:
  • .Net Framework:
  • Syncfusion Essential Studio Version:
  • RAM:
  • System Culture Information:

Regards,
Priyanga.E
 



VC Vili CANKAR March 12, 2018 11:07 PM UTC

Hi,

thanks for the sample and I could confirm that works with VS2012. But As I said, I don't use VS but Magic XPA and
everything else work, except this function ...
Something is wrong with enum datatype ...

Is it possible to cast numerical values (0,1,2) to viewer.PrinterSettings.PageSize ?

Regards 


PE Priyanga Elangovan Syncfusion Team March 14, 2018 12:50 PM UTC

Hi Vili,

Currently, we are trying to create the sample using Magic XPA software to reproduce the issue at our end. We will update the details once we have completed the sample creation using Magic XPA software.

Meanwhile can you please provide the simple runnable sample which has been created using Magic XPA software to reproduce the issue at our end? It will be more helpful to assist you better and provide the proper solution at the earliest.

Regards,
Priyanga.E
 



VC Vili CANKAR March 15, 2018 09:40 PM UTC

Hi,

sample is attached below.

Thanks and best regards.

Attachment: Syncfusion_pdfviewer_problem_MagicXPA3.2_e994091e.zip


PE Priyanga Elangovan Syncfusion Team May 18, 2018 10:13 AM UTC

Hi Vili,

Thank you for your patience.
 
We have finished analyzing the reported issue “Type casting error is thrown while setting the values to PageSize property of PrinterSettings”. We have confirmed it as defect and logged a defect report for the same. We will resolve this issue and include the fix for this issue in our 2018 Volume 2 SP1 release which will be available in the month of June 2018. 
Regards,
Priyanga.E
 


Loader.
Up arrow icon