How to export graphics2d To PDF using PDFCLown library - graphics2d

I am new to pdfClown. I have a Graphics2D data from my JAVA JCanvas i need to export this graphics2d data to PDF. How can i do that by using pdfclown? Please Help me.

At the moment, PDF Clown provides no adapters to translate Graphics2D calls into PDF: AFAIK, iText supports that.

Related

HTML export on EPPlus?

Had a quick question about the EPPlus library. Can it export an excel spreadsheet as an HTML page? The application I am writing needs to be able to do this.
You can use Spire.XLS which enables developers to convert Excel to other popular formats, such as PDF, XML, HTML, CSV, Image format etc
Its # Nuget, Install-Package Spire.XLS -Version 8.4.13
You could extract datatable from excel file using EPPlus and convert it to HTML using the code described here:
https://www.c-sharpcorner.com/UploadFile/deveshomar/export-datatable-to-html-in-C-Sharp/
Afterwards, you can export the html string to excel file as:
private void ExportToXLS(string data)
{
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.AddHeader("content-disposition",
"attachment;filename=Your_File_Name.xls");
HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
EnableViewState = false;
HttpContext.Current.Response.Write(HttpUtility.UrlDecode(data));
HttpContext.Current.Response.End();
}
EPPlus 6, released April 2022, has support for exporting ranges and tables to html with separate css. See these samples https://samples.epplussoftware.com/HtmlExport/

Easy tool for drawing graphs and export as xml, json?

Do you know a tool/application that allows me to draw a directed graph (with drag and drop would be ideally) and than easily export it into an XML or JSON file?
I tried using http://cmap.ihmc.us/ but it exports the picture into an XML not the graph's content, which it makes it horrible to parse.
The main goal is to draw a graph and then somehow construct it in memory (in C++/Java).
Gephi is a good free tool to create and export graphs:
https://gephi.org/
User made addons are available and allow you to export in multiple formats :
https://marketplace.gephi.org/plugin/json-exporter/

Can i use xml3d with stl models?

I'd really like to use STL models with XML3d. Is there a way to convert back and forth between these formats?
You can convert STL files to XML3D using the Blender exporter for instance:
https://github.com/ksons/xml3d-blender-exporter
Another option is to write a plug-in for STL files that allow to reference STL files from <mesh> and <data> elements:
<mesh src="foo/bar.stl"/>
This would be very similar to the existing plug-ins for MeshLab/JSON and OpenCTM files:
http://xml3d.github.io/xml3d-examples/examples/meshlab/meshlab.html
http://xml3d.github.io/xml3d-examples/examples/openctm/openctm.html
We've just released a new converter that uses the Open Asset Import Library to convert many 3D formats (including STL) to XML3D's asset format:
https://github.com/csvurt/assimp2xml3d
It can't convert from XML3D back to other formats, but this might be something we add in the future.
There is a plug-in for STL file now:
https://github.com/xml3d/xml3d-stl-plugin
It allows using STL files as simple as:
<mesh src="../path/to/model.stl"></mesh>

Convert sketchup (*.skp) file to STL or OBJ

I'm looking for the solutions to Convert sketchup (*.skp) file to STL or OBJ.
Is there a commandline tool to convert sketchup (*.skp) file to STL or OBJ? I'm looking for the tool supporting both windows and mac.
or
How to convert sketchup (*.skp) file to STL or OBJ in javascript?
Any clue or comment is appreciated.
Thanks,
Jeffrey
AFAIK there is no command line tool to do it. Much less a Javascript tool.
SketchUp itself does have the capability, so you can create a Ruby plugin to do the export when SketchUp is opened. So you can have a .bat file or whatever the Mac equivalent is, and let it run SketchUp with your plugin.
Or you can roll your own conversion tool using the SketchUp SDK. http://www.sketchup.com/intl/en/developer/su-api/ The SDK does not need the SketchUp installed, but on the other hand it does not have any built-in .OBJ export support, so you would need to implement the exporter yourself, only using the SDK for reading the SKP file. This might be quite involved.
SketchUp has an open source STL plugin which is accessible from the Extension Warehouse:
http://extensions.sketchup.com/en/content/sketchup-stl
The STL works for SketchUp Make (which is Free) and SketchUp Pro ($590). SketchUp Pro also includes a number of other export file formats, such as OBJ, 3DS, DAE, FBX, etc....
I know its not programatically, but last version of Sketchup has the option directly to export to OBJ file.
File Menu -> export -> 3D Model -> Then select from the dropdown of extensions the OBJ.

Convert .OBJ to JSON format with libgdx

I'm working on a project where we need to convert .OBJ models into .G3DJ (JSON) format on the fly. I've tried with this code I've founded in google code.
https://code.google.com/p/libgdx-users/wiki/ImportingModelsFromBlender
ObjLoader loader = new ObjLoader();
StillModel model = loader.loadObj(Gdx.files.internal("data/model.obj"), true);
G3dExporter.export(models, Gdx.files.absolute("data/model.g3d"));
But StillModel and G3DExporter cannot be found in libgdx.
Any ideas?
The libgdx-users wiki is not up to date. Converting an OBJ file to G3DJ (or G3DB) can be done using fbx-conv, which is a command line utility (you can call it from code if you like).
Also make sure to update to the nightly build. StillModel is no longer supported (and does not support the G3DJ (JSON) file format).
It is recommended not to use OBJ (although it is still supported). Instead use FBX (converted to G3Dx), which supports more functionality than OBJ.