This workflow converts a single image into a PDF using native VB.NET in UiPath Invoke Code.
It does not require any external libraries or packages.
The logic is simple and runs fully inside UiPath.
It is useful when you need to quickly turn an image into a PDF during an automation.
Can be improved so we can make resolution dynamic, or any other features.
I’m curious why you manually set pageW and pageH, then override that and get them from the pageSizeName (which is set as a variable instead of an argument) or get it from the image size. And why assign it to _name when you could just use pageSizeName which you already have?
If you want to handle multi-page images, you can use PDF Sharp. Don’t know if it’s possible with VB.net or what changes would need to be made. This works with other images besides TIFF.
I wanted to provide a case where you cannot use PDFSharp as let’s say you are not allowed to install any external library. The model is not finished and is a simple one to do the job, for sure we can do all that you mentioned also making customization more dynamic but for a showcase I stopped there