You can use the following code inside C# Invoke Code to output your string to PDF. Just need to install iText 7 Community package and import the following namespaces:
iText.Kernel.Pdf
iText.Layout
iText.Layout.Element
var text="Hello World!";
var filePath = "output.pdf";
PdfDocument pdfDoc = new PdfDocument(new PdfWriter(filePath));
Document doc = new Document(pdfDoc);
doc.Add(new Paragraph(text));
doc.Close();
Not seeing any error might be a bug in UiPath Studio.
Please try to set your parameter Output1 in the arguments of Invoke Code instead of defining the code as a function, then set the code as-is.
Could you provide us with Screenshot of the Error that you are receiving ? Also let us know if you are using the Windows Compatibility and not Windows-Legacy.
Hy @supermanPunch, Thanks for the reply.
I had made a mistake in defining the arguments and assigning it inside the invoke code. After defining it right as @kaydine said, it works well.