Artifact to PDF

Hello guys,

Hope you all are doing well.

I have one issue right now. I want to send the information which I receive from various steps in the artifact, to a specific mail address. It is usually a detailed info about the investigations dome by our SOC analysts, like title, severity, notes added onto the investigations, analyst mail id, name etc for each of the investigation. Now, I could send them as html in mail.

Does anyone of you know how can we convert the artifact content into pdf file and send that as an attachment?

Thank You!!

:page_facing_up: Generating and Sending a PDF via Email in InsightConnect

We have a PDF Generator plugin that can create PDFs from string input — typically your artifact output.


:wrench: Step 1: Generate the PDF

Use the PDF Generator Plugin.
Pass your artifact string as the input.

The plugin will return bytes as the output (your generated PDF).


:paperclip: Step 2: Attach the PDF to an Email

The Send Email step supports attachments using the following JSON structure:

[
  {
    "filename": "setup.exe",
    "content": "UmFwaWQ3IEluc2lnaHRDb25uZWN0Cg=="
  }
]
  • filename: The name you want the attachment to have.
  • content: The Base64-encoded content of your file.

:brain: Example: Attaching the Generated PDF

If your PDF generation step is named “Create PDF” and you want your file to be called AlertInfo.PDF, use this for your Send Email – Attachments input:

[
  {
    "filename": "AlertInfo.PDF",
    "content": "{{["Create PDF"].[pdf]}}"
  }
]

:white_check_mark: Summary

  1. Pass your artifact to the PDF Generator step.
  2. Use the step’s output ([pdf]) as the attachment content.
  3. Set your desired file name (e.g., AlertInfo.PDF).
  4. Include that JSON in your Send Email step under attachments.
1 Like

Hey Darrick, thanks for the solution.

It worked almost fine. But one issue I could see is that, if I have used formatting in my Markdown Artifact, and use artifact.content as an input in pdf generator step, the generated pdf will have those content as is, I mean if I formatted the artifact output to make some words as Bold(by using __ or **), instead of getting them in Bold I am seeing those asterick or underscore characters as well.

So, If you have any suggestions or know any workarounds on this, please help me with that.

Thank You :slight_smile:

A PDF doesn’t use Markdown for formatting. You would need to use a language that PDF accepts for formatting.

A colleague just shared this with me. I’ve never used it, nor did I know it exists, but it appears to have what you need.

1 Like

Yes Darrick, tried with this. Working fine for me.

Thank you :slight_smile: