Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active March 9, 2021 18:17
Show Gist options
  • Save aspose-com-gists/dbe03a37114bd480493e67d6beb9d653 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/dbe03a37114bd480493e67d6beb9d653 to your computer and use it in GitHub Desktop.
Convert GIF to PDF C#
// Load GIF image
Image image = Image.Load("gif.gif");
// Set PDF options
PdfOptions options = new PdfOptions();
// Create PdfDocumentInfo object and add information
PdfDocumentInfo docInfo = new PdfDocumentInfo();
docInfo.Author = "Aspose";
docInfo.Keywords = "GIF to PDF";
docInfo.Subject = "GIF to PDF Convesion";
docInfo.Title = "Converting GIF Image to PDF File";
// Set document info
options.PdfDocumentInfo = docInfo;
// Save GIF as PDF file
image.Save("gif-to-pdf.pdf", options);
// Load GIF image
Image image = Image.Load("gif.gif");
// Set PDF options
PdfOptions options = new PdfOptions();
// Convert first frame of GIF to PDF
options.MultiPageOptions = new MultiPageOptions(new IntRange(1, 1));
// Save GIF as PDF file
image.Save("gif-to-pdf.pdf", options);
// Load GIF image
Image image = Image.Load("gif.gif");
// Set PDF options
PdfOptions options = new PdfOptions();
// Set size of the page
options.PageSize = new SizeF(50, 100);
// Save GIF as PDF file
image.Save("gif-to-pdf.pdf", options);
// Load GIF image
Image image = Image.Load("gif.gif");
// Set PDF options
PdfOptions options = new PdfOptions();
// Save GIF as PDF file
image.Save("gif-to-pdf.pdf", options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment