I am converting html to pdf using iText7 with method convertToPdf(). PDF is getting generated properly but Landscape mode is not working.
Can some one tell how to get Landscape mode?
import com.itextpdf.html2pdf.ConverterProperties;
import com.itextpdf.html2pdf.HtmlConverter;
import com.itextpdf.styledxmlparser.css.media.MediaDeviceDescription;
import com.itextpdf.styledxmlparser.css.media.MediaType;
import java.io.File;
import java.io.IOException;
import static com.itextpdf.html2pdf.css.CssConstants.LANDSCAPE;
public class htmlToPDF {
public static void main(String args[]) throws IOException {
ConverterProperties properties = new ConverterProperties();
MediaDeviceDescription med = new MediaDeviceDescription(MediaType.ALL);
med.setOrientation(LANDSCAPE);
properties.setMediaDeviceDescription(med);
HtmlConverter.convertToPdf(new File("D:\\test.html"), new File("D:\\test.pdf"),properties);
}
}