#29454

I guess I misunderstood you first time. PD4ML does not support a dynamic format change: for example, the first page is portrait, the second is landscape.

To avoid possible code errors, try to define format explicitly, without conditions:

Portrait:
pd4ml.setPageSize( PD4Constants.A4 );

Landscape:
pd4ml.setPageSize( pd4ml.changePageOrientation( PD4Constants.A4 ) );