Skip to content

Instantly share code, notes, and snippets.

Aspose.com Gists aspose-com-gists

Block or report user

Report or block aspose-com-gists

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View convert-psd-layer-to-image.cs
// Load an existing PSD image as Image
using (PsdImage image = (PsdImage)Image.Load("Photoshop.psd"))
{
LayerGroup formats = (LayerGroup)image.Layers[1];
formats.Save("formats.png", new PngOptions());
Console.ReadKey();
}
@aspose-com-gists
aspose-com-gists / Aspose.Imaging-for-.NET
Created Mar 26, 2020 — forked from aspose-imaging/Aspose.Imaging-for-.NET
This Gist contains .NET code snippets for examples of Aspose.Imaging for .NET.
View Aspose.Imaging-for-.NET
Aspose.Imaging-for-.NET
View add-page-document-to-xps.cpp
// New document (1 fixed document with 1 default size page)
auto doc = System::MakeObject<XpsDocument>();
// Add 2nd page on 1st document and set active
doc->AddPage();
// Add 2nd document with 1 page (3rd page in file)
doc->AddDocument(false);
// 1st document's 2nd page is still active
System::SharedPtr<XpsSolidColorBrush> textFill = doc->CreateSolidColorBrush(System::Drawing::Color::get_Black());
System::SharedPtr<XpsGlyphs> glyphs = doc->AddGlyphs(u"Arial", 12.0f, System::Drawing::FontStyle::Regular, 200.f, 500.f, u"Text on Page 2 (Document 1),");
glyphs->set_Fill(textFill);
View convert-pdf-to-ppt-slide-images.cs
// Load PDF document
Document pdfDocument = new Document("document.pdf");
PptxSaveOptions pptxOptions = new PptxSaveOptions();
pptxOptions.SlidesAsImages = true;
// Save output file
pdfDocument.Save("PDF to PPT.ppt", pptxOptions);
View create-pdf-in-cpp-attachment.cpp
// Create a text file
System::IO::File::WriteAllText(u"Attachment.txt", u"Some info");
SharedPtr<FileSpecification> fileSpecification = MakeObject<FileSpecification>(u"Attachment.txt", u"Sample text file");
// Add attachment to document's attachment collection
auto doc = MakeObject<Document>();
doc->get_EmbeddedFiles()->Add(fileSpecification);
// Add a page to PDF
doc->get_Pages()->Add();
// Save PDF document
doc->Save(u"Created PDF.pdf");
View Aspose.OCR for C++
This gist contains code snippets for Aspose.OCR for C++ API.
View 01_Aspose.Finance for .NET
This gist contains code snippets for Aspose.Finance for .NET API.
View convert-odp-to-pdf-with-aspose-slides.cs
// Instantiate a Presentation object that represents an ODP file
Presentation presentation = new Presentation("PowerPoint.odp");
// Save the presentation as PDF
presentation.Save("ODP-to-PDF.odp", SaveFormat.Odp);
View create-Word-document-with-image.java
// Create a Document object
Document doc = new Document();
// Create DocumentBuiler
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert Image
builder.insertImage("aspose-words.png");
// Save the document
doc.save("Rich Word Document.docx");
You can’t perform that action at this time.