How to use an image asset with .ai extension in Flutter? - flutter

For example, image.ai is the file name. I am unable to use it regularly. Is there something specific I must to do use this?

The .ai format is most commonly used for Adobe Illustrator.
This format is not directly usable in flutter, it is also not used directly in application and web-development as to my best knowledge this a propriety format.
To use the asset in flutter you must export the asset from Adobe Illustrator to one of the formats supported in flutter such as .png or .jpeg
If you must use a vector based format, you could try using the asset as an .svg with the flutter_svg package

The .ai format is the extension of Adobe Illustrator, and it cant be opened in any other app or development platform, except Adobe Suit. So you can just export your file as.png or.jpeg.
You can do this by going to the menu on the top file<<export<export for screens, then you can save it in different file formats as mentioned.

Related

Flutter pdf to ppt convertor

Is there any way to directly convert pdf file to ppt in flutter?
Anybody can suggest me some package for this
I have searched for such package but I haven't got anyone
You could go with this 2 ways:
Directly PPT Conversion: You could give this power_file_view package a check where you could pass in a pdf from the app or from the network as a parameter in it and then convert it to ppt.
Convert File to PDF then PPT: Check out the syncfusion_flutter_pdf: ^20.4.49 in this, you could create PDF Files and then Convert it to PPT using above Package.
Choose any approaches that suit your need :)

DOCX viewer in flutter

Is DOCX viewer in flutter possible.
I have tried PDFTron, it has the following drawbacks:
Not a widget
Paid version
If DOCX viewer is not available, then is DOCX to PDF converter available?
Use ConvertAPI, but if you want and offline solution i do not believe i came across one or you can useFFI if you found a native code for conversion
You can take a look to flutter_filereader package. It has a lot of file types. I suggest to you.

Import .ai (illustrator file) in Unity and display them

I want to load an illustrator file in my game. Unity should recognize different layers, colors, and forms, and layers with text and display them in a 2d canvas.
The goal is that the players can click on different forms and that unity recognize them as individual forms. Do you know any unity asset or a way to make this possible?
For example when you import an image like this as an illustrator file -> https://www.mandala-bilder.de/mandala/erwachsenemandalas/mandala-ideen-erwachsene.pdf
I thought about an SVG file but then I canĀ“t use the different layers.
Illustrator has a proprietary file format, it has no publicly available documentation for newer versions. While you can dig out old specifications (this is why some programs only support AI files saved in ancient versions) http://www.idea2ic.com/File_Formats/Adobe%20Illustrator%20File%20Format.pdf I do not think you can just go in and start supporting a 2021 variant without requesting (and motivating) the spec from Adobe. They might also want to charge you for it.
SVG on the other hand is free and it's spec is public so there is much widely spread support. also SVG supports groups which can get your around the need for layers
Vector Express is a free conversion API you should be able to use. (requires a network connection, though)
https://github.com/smidyo/vectorexpress-api
You should be able to POST a request (https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.Post.html) to this endpoint, with the raw AI file as the body:
POST https://vector.express/api/v2/public/convert/ai/gs/pdf/psd2svg/svg/
This will return a JSON object with a link to an SVG file that you can then download and display.

Displaying Rich Text (.rtf) in JavaFX

I have a .rtf file that I need to display within a JavaFX GUI.
My research indicates that the JavaFX TextFlow supports rich text through a tree of Node objects. However, I am at a loss on how to get my .rtf file represented as this tree of Nodes.
I feel like there should be an intuitive way to parse the .rtf file into the Node tree, but I just can't seem to find a way to do it!
Parsing RTF and Rendering in a TextFlow
You could parse the rtf and generate a TextFlow representation of it (similar as is done for this markdown editor for markdown markup). I believe this would be a difficult task for you (the RTF 1.9.1 specification is 277 pages long). Describing how to do this would be too long and complicated for a StackOverflow answer (even if I could describe it, which I probably could not).
Converting RTF to a format JavaFX can more easily render
I suggest using a converter (either offline or using an online service) to convert your RTF to another format before trying to render it in JavaFX. If you know the documents in advance you can pre-convert before shipping your application, if you don't then you will have to provide a real-time conversion facility with your application. I won't recommend a particular service, but you can google and do some research on RTF conversion to see if there is one that fits. As a target format you could choose PDF or HTML, or an image (e.g. PNG).
JavaFX will natively display:
Images using an ImageView.
HTML using a WebView.
A 3rd party library can be used to display PDF documents or other formats using JavaFX.

FreeTypeFontGenerator for GWT

I'm using Libgdx to write an Android and HTML5 app. I have found out that FreeTypeFontGenerator doesn't work for a GWT application and truetype is deprecated. What shall I use if I want to use fonts in a GWT application?
You use BitmapFont just like you do in any LibGDX application, it is the standard mechanism to support fonts in LibGDX. FreeTypeFontGenerator is an extension that doesn't work for GWT because it features native code. If you need to pre-generate some new font files of different sizes and types you can use Hiero or my favorite BMFont.
There might be some better way, but if you can't find any, you can prerender the font in a few sizes with the Hiero tool built into the gdx-tools project, and choose the most fitting one at runtime. Hiero generates a .png and a file describing the characters in that image which you can simply load, e.g.:
BitmapFont font = new BitmapFont(Gdx.files.internal("data/font/font"+sizeNum+".fnt"));