Last active
March 9, 2021 18:17
-
-
Save aspose-com-gists/dbe03a37114bd480493e67d6beb9d653 to your computer and use it in GitHub Desktop.
Convert GIF to PDF C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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