Graphic layer to Json format : ArcGIS api for javascript - arcgis

In my application I am converting annotation feature to graphic layer and then converting same graphics to json for printing. I know how to converted annotation features to graphic but I do not have knowledge how to convert graphic to json.

The Graphic class has a toJson() method - would that work?

Related

Convert - GLTF/STL/OBJ file formats to U3D file for PDF page

I am trying to add three.js based 3D objects to a PDF page. It seems there are no direct exporters available to do that. So I am trying to do the below thing,
Convert the gltf/stl/obj files to U3D files
Add the .u3d file to PDF page.
I am trying to do the below process and I am not sure whether this approach is possible. It will be a great help if there is any support available to do any one of the below conversions. Also if you know any other possible approaches, kindly update me!!
Input formats output format
GLTF
OBJ U3D
STL
(any
three.js supported
3D formats)
Thanks.
There are few options available to export the three.js graphics to a PDF ( static content not a dynamic U3D assets)
Static contents
Get the rendered data from the three.js webGL renderer / canvas renderer using toDataURL("image/jpeg"), change the MIME type to JPG/PNG and add the resulting stream as an image to PDF ( this worked for me)
example - https://plnkr.co/edit/Ty8BZaDcflCJH5tH?preview
Like the above approach we can use three.js svgrenderer to export the renderer contents into a SVG data stream, which can be added into the PDF ( textures, mesh may not be 100% reproduced)
The legacy API - "threejs-pdf-renderer" can be used to directly export the three.js animations to a PDF. We don't need any other dependencies to create the PDF. But this is a legacy API which uses legacy three.js version, lot of effort needs to be done to make the API to be compatible with the latest three.js version.
example - https://satheeshks10.github.io/ThreejsPDFGenerator/
Dynamic 3D contents
We can export the three.js animations into a U3D file (no direct support is available as for now), this U3D file can be directly embedded into PDF.
example - https://tetra4d.com/pdf-samples/

Syncfusion html-pdf Vs JsReoprt html-pdf. Which is better?

I'm trying to create generate dynamic pdf generating from html (will also involve images too, not just text) in asp.net core and thinking of using either jsReport or Syncfusion for this. which is better? any pros and cons for both? speed? Please what are your thoughts?
Syncfusion HTML to PDF converter supports conversion in .NET Core using WebKit rendering engine. WebKit rendering engine preserves the output PDF document like how the input HTML file/URL is displayed on the WebKit based web browsers (safari). The performance of the converter is purely depends of the input HTML file/URL. The output PDF document preserves all the graphics, images, text, fonts, and the layout of the original HTML document/webpage. So, we suggest you to try our WebKit rendering engine for converting HTML to PDF.
WebKit rendering engine supports more features such as JavaScript, additional delay, bookmarks, forms, toc etc., when converting the HTML to PDF, Please refer below links for more information about HTML to PDF converter.
UG : https://help.syncfusion.com/file-formats/pdf/convert-html-to-pdf/webkit
FT : https://www.syncfusion.com/pdf-framework/net/html-to-pdf
Online Sample : https://mvc.syncfusion.com/demos/web/pdf/htmltopdf
Note: I work for Syncfusion.

Convert front panel screenshot to base64 string using LabVIEW 2018

I need to convert the screenshot of the front panel of the application into a Base64 string to post it to a web API. The block diagram is:
I used a "base64_fast_encode" utility vi from the link
https://forums.ni.com/t5/Example-Programs/Fast-Base64-Encoder-Decoder-using-LabVIEW/ta-p/3503281
Please find the encoded base64 string file from the link:
https://fil.email/WFBxwWyr
I pasted the resultant encoded base64 string in the below website:
https://codebeautify.org/base64-to-image-converter#
And I observed that it is not decoded back to image.
Please suggest if there are any other utility vis to convert to base64. If not, suggest an alternative of doing it.
Thanks in advance.
What you are missing is converting the LabVIEW image data to a more generic image format that would be understood outside of the context of LabVIEW, such as by the CodeBeautify tool. All you need to do is convert Image Data using LV Image to PNG Data.VI to PNG before you encode it.
Using the below example, if I take the base64 encoded string output and use the CodeBeautify base64-to-image-converter tool, it does show the expected image.

How to convert WritableBitmap to Base64 string

In my application I am using WriteableBitmapRenderExtensions.Render() method present in WinRT XAML toolkit for rendering xaml element. After rendering the xaml control I need to send this to server in the form of Base64 string. How I can convert this WritableBitmap class in to Base64 string?
Save the WriteableBitmap to a png or jpg (there's an extension for that in the toolkit that you can probably modify to get the compressed image as byte array) to reduce the data size and then use Convert.ToBase64String() as Chris suggested to convert the bytes to Base64 string.

Using iOS, Tiled, Box2D and XCode. Problems importing my own .tmx files

So I'm getting the error "TMX: unsupported compression method" using this tutorial's code and any of my own created TMX tiled map editor files.
I was just trying to figure out how to use tiled to make interesting maps, since I am creating a side scrolling game I was using this as a reference.
Any help would be appreciated :)
Tiled has multiple compression modes for saving - under File -> Preferences -> Store tile layer data as: for iOS and Box2D, this should be set to Base64 (gzip compressed).