Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active May 28, 2021 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/26a955193719a219fd8db89eb6de7516 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/26a955193719a219fd8db89eb6de7516 to your computer and use it in GitHub Desktop.
Convert MSG and EML to PDF in Java
// Convert EML message to PDF
public void convertEmltoPDF(String filePath)
{
Converter converter = new Converter(filePath + "emailMessage.eml");
PdfConvertOptions options = new PdfConvertOptions();
converter.convert(filePath + "eml-Message.pdf", options);
}
import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.options.convert.PdfConvertOptions;
public class EmailMessagesConverter
{
// Convert MSG message to PDF
public void convertMsgtoPDF(String filePath)
{
Converter converter = new Converter(filePath + "emailMessage.msg");
PdfConvertOptions options = new PdfConvertOptions();
converter.convert(filePath + "msg-Message.pdf", options);
}
}
@horrito
Copy link

horrito commented Oct 14, 2020

I downloaded from the link "GroupDocs.Conversion for Java 1.0.0" the jar file "GroupDocs.Conversion.jar".
There is not a package "com.groupdocs.conversion".
There is not a package "com.groupdocs.conversion.options.convert".
Please, could someone help me? I just need this java code but it doesn't work.

@atirtahirgroupdocs
Copy link

@horrito

Please download latest version of the JAR (20.10) here and let us know if you still get such errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment