Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active January 7, 2022 06:32
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/07d6814f87a48e2a208698b1dfeaab52 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/07d6814f87a48e2a208698b1dfeaab52 to your computer and use it in GitHub Desktop.
View STL File as HTML, PDF, JPG or PNG using C#
using (Viewer viewer = new Viewer("path/input.stl"))
{
HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources("path/stl-output.html");
viewer.View(options);
}
using (Viewer viewer = new Viewer("path/input.stl"))
{
JpgViewOptions options = new JpgViewOptions("path/stl-output.jpg");
viewer.View(options);
}
using (Viewer viewer = new Viewer("path/input.stl"))
{
PdfViewOptions options = new PdfViewOptions("path/stl-output.pdf");
viewer.View(options);
}
using (Viewer viewer = new Viewer("path/input.stl"))
{
PngViewOptions options = new PngViewOptions("path/stl-output.png");
viewer.View(options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment