Autodesk Viewer load saved markups from SVG file - node.js

I'm currently working with the Autodesk Viewer API to display and add markups to DWG files. I now can add markups and retrieve them.
I saved one markup as a svg file and now, I'm looking for a way to load the SVG file to display the markup on my viewer.
Do you have any idea on how I could do that?
Thanks.

Markups can be loaded using the loadMarkups method. Here's an example: https://developer.api.autodesk.com/viewingservice/v1/viewers/docs/tutorial-feature_markup.html#saving-and-loading-markups.

Related

Nodejs muhammara insert SVG to pdf, or read exist PDF with PDFmake content and save it as other

I am using NodeJS and I want to modify uploaded PDF file by add svg.
I tried to use Muhammara/Hummus and it is great to edit but it can not handle SVG, only JPEG.
I also Tried PDFmake, but as far i know, I can not read PDF with this tool, just create PDF from documentData obj.
Is there any possibility accomplish mentioned goal in Nodejs?
Regards

Convert SVG file to Autodesk Viewer svf format

We are looking at using the Forge Viewer for a project to display and markup plans, etc. (for now just 2D, 3D may be added in the future). For some of these items we will have DWG Files that we can convert using model derivative API so no problem there. However, the client also has quite a few existing drawings saved in svg format from their legacy system.
The question is if there is a good way to convert those base svg files into svf that we can display as the 'main' drawing/view in Forge Viewer. I have found things about creating a markup layer from an svg file, but that's not really what we want. We would be using markups to have the user draw on top of the plan with their own tools and place markers, etc. but the main drawing should be from the svg file that they have.
Forgive me if this is simple but I'm fairly new to the viewer and model derivative API so I'm not figuring out how to make this work.
There is no translation support for SVG, to generate an SVF model out of it.
You could either
a) use the SVG inside a format that we support (e.g. DWG - perhaps place the SVG in it using Design Automation API) and translate that to SVF
b) load a dummy model as shown here, and then add the SVG as e.g. markup

Recognised file types for image preview?

Is it possible to add additional file types to be recognised as images and thus trigger automatic creation of an image view when a resource is uploaded?
SVG files will preview in CKAN, but we have to manually add the image view e.g.
https://datastore.landcareresearch.co.nz/dataset/novel-yeasts-from-new-zealand-forests/resource/3812ee6b-dd45-45c9-b425-6a18375e5727
With text (for example) we can specify file format extensions to recognise as text and automatically create a text preview (ckan.preview.text_formats...). Is there an equivalent for images?
Thanks
It would only be possible by modifying the source code for your instance:
https://github.com/ckan/ckan/blob/master/ckanext/imageview/plugin.py#L9
Seems like a great idea to have the image view on a par with the text view in this regard, so I made a pull request:
https://github.com/ckan/ckan/pull/3380

Save Openstreetmap, Openlayers output as .png or .svg, server-side

I'm currently building a web application with Openlayers that draws routes en points of interest on a map. This map needs to be saved to a file on the server (.png of .svg), so it can be embedded in a .pdf file. The route and POI information is available as KML file.
What is the easiest way to do this?
You have several options:
Directly export your OpenLayers map to a PNG or even a PDF on the client-side (see these two examples: png export and pdf export).
Use wkhtmltopdf to export a HTML page containing an OpenLayers map to a PDF (on the server-side).
Use MapFish Print 3 which is a print server to generate PDF reports containing maps. You would create a report template and configuration and then send a print request containing the geo-data that you want to print (e.g. tile layers or GeoJSON data).

Convert Google Spreadsheet Diagram into SVG and using it in an Ionic app

For a mobile app (built with the Ionic framework), I want to use a diagram I created with Google Spreadsheets. Following the steps described on this page I managed to save the diagram as an .svg file by copying the svg code shown in Chrome Dev Tools.
I then used the .svg file in the src attribute of the img tag, as described in this question.
Unfortunately, this does not show the image. Does the svg code of Google contain some code which doesn't make it render? Here is the link to the svg code.
Standalone external SVG must have a namespace declaration. They are XML files and the browser needs to know what type of XML they are (in this case an SVG).
You'll need to alter the first line of the SVG file to:
<svg xmlns="http://www.w3.org/2000/svg" width="786" height="459" overflow="hidden">
Try that.

Resources