We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Set PdfOptions using reflection

Hi,

I am trying to set pdf options using reflection.
But, I am unable to set compliance field.

Following is the snippet:
PdfOptions pdfOptions = new PdfOptions();
Class<? extends PdfOptions> classHere = pdfOptions.getClass();
Field field = classHere.getDeclaredField(“compliance”);
field.setAccessible(true);
field.set(pdfOptions, PdfCompliance.Pdf15);
pdfOptions.getCompliance();

Could please introspect the problem. Is it due to compliance being privite member?

Thanks,
Jaspreet

Hi Jaspreet,


Please share the complete sample code with us to further investigate your issue with input file as I am unable to understand the code segment shared by you. We will look into it and will get back to you.

Thanks & Regards,