Convert JPG to PDF

Convert JPG to PDF in C#

A very common use case you can see over the internet is converting JPG to PDF, e.g. sometime you need to publish a JPG into PDF format. GroupDocs.Conversion (which is a part of Conholdate.Total for .NET) API allows to do this job in an easy and intuitive way. You need to write just a few lines of C# code. Just follow the steps below:

  • Instantiate Converter class and pass source JPG file path as a constructor parameter. The path might be absolute or relative as per your requirements.
  • Instantiate of PdfConvertOptions class.
  • Call Converter class Convert method and pass the filename for the converted PDF file and the PdfConvertOptions object from the previous step as parameters.