Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active February 14, 2020 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aspose-com-gists/5f334c37357a615762e45eec01316707 to your computer and use it in GitHub Desktop.
Save aspose-com-gists/5f334c37357a615762e45eec01316707 to your computer and use it in GitHub Desktop.
This Gist contains code snippets of Aspose.PUB for .NET
This Gist contains code snippets of Aspose.PUB for .NET
// For complete examples and data files, please go to https://github.com/aspose-pub/Aspose.PUB-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Data();
string fileName = dataDir + "halloween-flyer.pub";
var parser = PubFactory.CreateParser(fileName);
var doc = parser.Parse();
Aspose.Pub.PubFactory.CreatePdfConverter().ConvertToPdf(doc, dataDir + "result_out.pdf");
// For complete examples and data files, please go to https://github.com/aspose-pub/Aspose.PUB-for-.NET
Console.WriteLine("Assembly Version: {0}", Aspose.Pub.BuildVersionInfo.AssemblyVersion);
Console.WriteLine("File Version: {0}", Aspose.Pub.BuildVersionInfo.FileVersion);
Console.WriteLine("Product: {0}", Aspose.Pub.BuildVersionInfo.Product);
// For complete examples and data files, please go to https://github.com/aspose-pub/Aspose.PUB-for-.NET
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Data();
string fileName = dataDir + "Aspose.PUB.Lic";
License pubLicense = new License();
pubLicense.SetLicense(fileName);
// For complete examples and data files, please go to https://github.com/aspose-pub/Aspose.PUB-for-.NET
// Initialize license object
License pubLicense = new License();
// Load license in FileStream
FileStream myStream = new FileStream("Aspose.PUB.lic", FileMode.Open);
// Set license
pubLicense.SetLicense(myStream);
// For complete examples and data files, please go to https://github.com/aspose-pub/Aspose.PUB-for-.NET
string dataDir = RunExamples.GetDataDir_Data();
string pubFile = dataDir + "document.pub";
IPubParser parser = PubFactory.CreateParser(pubFile);
Document document = parser.Parse();
document.DocumentSummaryInfo.SetCategory("category");
document.DocumentSummaryInfo.SetCompany("company");
document.DocumentSummaryInfo.SetLanguage("language");
document.SummaryInfo.SetComments("comments");
document.SummaryInfo.SetKeywords("keywords");
document.SummaryInfo.SetLastAuthor("last author");
document.SummaryInfo.SetTitle("title");
document.SummaryInfo.SetSubject("subject");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment