Skip to content

Instantly share code, notes, and snippets.

View aspose-com-gists's full-sized avatar

Aspose.com Gists aspose-com-gists

View GitHub Profile
@aspose-com-gists
aspose-com-gists / svg-to-pdf.py
Last active September 30, 2025 19:52
Convert SVG to PDF in Python
import aspose.cad as cad
from aspose.cad.imageoptions import PdfOptions
# Define the path for the working directory and apply Aspose.CAD license.
dataDir = "data"
license = cad.License()
license.set_license("latest.lic")
# Load the source SVG file by calling the load method.
image = cad.Image.load(dataDir+"paths.svg")
# Create an instance of the CadRasterizationOptions class.
cadRasterizationOptions = cad.imageoptions.CadRasterizationOptions()
@aspose-com-gists
aspose-com-gists / extractReactionsFromMsg.js
Created September 26, 2025 16:03
How to Extract Outlook Reactions from MSG Files in Node.js
const ae = require('@aspose/email');
// Load the MSG file
const msg = ae.MapiMessage.fromFile("sample_reaction.msg");
// Get the list of reactions
const reactions = ae.FollowUpManager.getReactions(msg);
// Display reaction details
if (reactions && reactions.length > 0) {
@aspose-com-gists
aspose-com-gists / emoji_lookup_dictionary.py
Created September 26, 2025 15:59
Extract Outlook Reactions from MSG Files in Python
emoji_map = {
"like": "👍",
"love": "❤️",
"laugh": "😂",
"surprised": "😮",
"sad": "😢",
"angry": "😠"
}
print("Emoji:", emoji_map.get(reaction.reaction_type, ""))
@aspose-com-gists
aspose-com-gists / CheckVcfIsMultiple.cs
Created September 26, 2025 15:54
Read and Convert Multi-Contact VCF Files in C#
bool hasMultipleContacts = VCardContact.IsMultiContacts("multi_contacts.vcf");
Console.WriteLine("The VCF file contains multiple contacts: " + hasMultipleContacts);
@aspose-com-gists
aspose-com-gists / AppendGmailMessages.cs
Created September 26, 2025 15:47
Integrate Gmail in C# with OAuth2 Authentication
using (IGmailClient client = GmailClient.GetInstance(clientId, clientSecret, refreshToken, email))
{
// Create a message to append to the "Inbox"
MailMessage message = new MailMessage("[email protected]", "[email protected]", "Subject for inbox message", "Body of the message");
// Append the message to the inbox with the "INBOX" label
string messageId = client.AppendMessage(message, "INBOX");
Console.WriteLine($"Message appended to the Inbox. ID: {messageId}");
}
@aspose-com-gists
aspose-com-gists / ConvertingMsgToOft.cs
Created September 26, 2025 15:42
Read, Create, and Edit Outlook Email Templates (OFT) in C#
var msg = MapiMessage.Load("input.msg");
msg.Save("template.oft", SaveOptions.DefaultOft);
@aspose-com-gists
aspose-com-gists / CombineMessageFilteringAndPagination.cs
Created September 26, 2025 15:36
Filter and Paginate MBOX Emails in C#
var reader = MboxStorageReader.CreateReader("input.mbox", new MboxLoadOptions());
// Filter: messages from a specific domain and sent this year
var mqb = new MailQueryBuilder();
mqb.From.Contains("@example.com");
mqb.SentDate.Since(new DateTime(DateTime.Today.Year, 1, 1));
var query = mqb.GetQuery();
// Page through message info (metadata only)
@aspose-com-gists
aspose-com-gists / DownloadAttachments.cs
Created September 26, 2025 15:32
Extract Properties, Attachments, and Recipients from PST Files in C#
// Load the PST file
using (var pst = PersonalStorage.FromFile("sample.pst"))
{
// Specify the EntryId of the target message
var targetEntryId = "..."; // Your message's EntryId here
// Extract the attachments collection for this message
var attachments = pst.ExtractAttachments(targetEntryId);
// Check if any attachments exist
@aspose-com-gists
aspose-com-gists / ExportVcfContactsToHtml.cs
Created September 26, 2025 15:27
Convert Outlook VCF to HTML and HTML to VCF in C#
var msg = MapiContact.FromVCard("contact.vcf").GetUnderlyingMessage();
var htmlSaveOptions = new HtmlSaveOptions
{
HtmlFormatOptions = HtmlFormatOptions.RenderVCardInfo | HtmlFormatOptions.WriteHeader
};
msg.Save("contact.html", htmlSaveOptions);
@aspose-com-gists
aspose-com-gists / Aspose.HTML for Python via .NET – Work with HTML Documents
Last active October 6, 2025 19:09
Create, load, edit and save HTML code using Python
Aspose.HTML for Python via .NET – Work with HTML Documents