-1
Windows Forms C# - Nuget-Package: Install-Package itext7.pdfhtml -Version 2.1.1

I am using this package for my project. How can I rotate or set page size. I am not using Document doc.

string RaporTemp = Dizinler.RaporTemp + "Temp_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".html";

string Output = Dizinler.PDFs + "Cari_Hareketleri_" + DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".pdf";

File.WriteAllText(RaporTemp, text);
HtmlConverter.ConvertToPdf(new FileInfo(RaporTemp), new FileInfo(Output));

Process.Start(Output);
Mehmet Erdoğdu
  • 190
  • 2
  • 8
  • Possible duplicate of [how to rotate pages but not the text in iText?](https://stackoverflow.com/questions/43579992/how-to-rotate-pages-but-not-the-text-in-itext) – vahdet Feb 18 '19 at 07:45

1 Answers1

0

The solution is as follows: use the converter method which has either a Document or a PdfDocument as one of its arguments.

If you prefer the former, then create the Document instance using the needed page size. If you prefer the latter, then set the default page size of the PdfDocument instance with SetDefaultPageSize(PageSize) method.

There should be no problem for you to move from one converter method to another, because the method which you use implicitly creates a PdfDocument instance and calls the method which requires it as an argument.

Uladzimir Asipchuk
  • 2,368
  • 1
  • 9
  • 19