I have a pdf file with some text input fields.
I’ve installed the itext7 (8.0.4) nuget package for C# to work with pdf files and I need to fill in the text fields and then rotate them around 25 degrees.
I asked chatgpt for a solution, and it came up with this:
using iText.Forms.Fields;
using iText.Kernel.Pdf;
PdfDocument pdfDoc = new PdfDocument(new PdfReader("input.pdf"), new PdfWriter("output.pdf"));
PdfAcroForm form = PdfAcroForm.GetAcroForm(pdfDoc, true);
PdfFormField field = form.GetField("fieldName");
field.SetRotation(90); // Set rotation angle in degrees
pdfDoc.Close();
but there is no SetRotation method for PdfFormField. This is the main issue.
I am VERY new to C#, I mostly did Vue components with typescript so I can’t properly navigate this issue.
On the offhand discussion – I am really close to just creating my own PDF library (probably shouldn’t do that) – are there any good tutorials for creating pdf files from scratch? 🙂