How to convert tiff files into single PDF file using uipath activities?

Need convert multiple tiff files into single pd

@Nagarjunas

Welcome to the uipath community.

We do not have any activities to convert Tiff file into PDF file.

Open one by one Tiff file and then save it as PDF files.

You can use PDF Sharp

Dim destinaton As String = in_PDF_Destination
Dim MyImage As System.Drawing.Image = system.Drawing.Image.FromFile(in_TIF_Location)
Dim doc As PdfDocument = New PdfDocument()

For PageIndex As Integer = 0 To MyImage.GetFrameCount(FrameDimension.Page) - 1
    MyImage.SelectActiveFrame(FrameDimension.Page, PageIndex)
    Dim img As pdfsharp.Drawing.XImage = pdfsharp.Drawing.XImage.FromGdiPlusImage(MyImage)
    Dim page As PdfPage = New PdfPage()

    If img.Width > img.Height Then
        page.Orientation = PageOrientation.Landscape
    Else
        page.Orientation = PageOrientation.Portrait
    End If

    doc.Pages.Add(page)
    Dim xgr As XGraphics = XGraphics.FromPdfPage(doc.Pages(PageIndex))
    xgr.DrawImage(img, 0, 0)
Next

doc.Save(destinaton)
doc.Close()
MyImage.Dispose()
2 Likes

Good one @bradsterling
@Nagarjunas - also you can do it by importing pdftextsharp dll

Thank you