Skip to content

Instantly share code, notes, and snippets.

@groupdocs-com-kb
Last active December 6, 2023 17:46
Convert JPG to PDF Using C#. For more information, please follow link: https://kb.groupdocs.com/conversion/net/convert-jpg-to-pdf-using-csharp/
using GroupDocs.Conversion;
using GroupDocs.Conversion.Options.Convert;
namespace ConvertJPGtoPDFUsingCSharp
{
internal class Program
{
static void Main(string[] args)
{
// Set License to avoid the limitations of Conversion library
License lic = new License();
lic.SetLicense(@"GroupDocs.Conversion.lic");
// Load the source JPG file
using (var converter = new Converter("input.jpg"))
{
// Set the convert options for PDF format
var options = new PdfConvertOptions();
// Convert to PDF format
converter.Convert("converted.pdf", options);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment