Acumatica. How we can add our own icons to the Modern UI? - acumatica

How we can add our own icons (like this https://snag.gy/lEh0NT.jpg) to the Modern UI through customization project? So we have .svg files and we need that in the Modern UI we can use this icons like others.
Thanks

For the workspaces and tiles in the modern UI, Acumatica ERP uses the icons from the font based on Font Awesome. Starting from Acumatica ERP 2017 R2 Update 5 (17.205.0015), you can create custom icons as SVG files and use them for the workspaces and tiles along with or instead of the default icons, as described in this topic.
To Add an SVG Icon for a Workspace or Tile
Create an SVG file with the icon. The following code shows an example of an SVG file.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z"/>
</svg>
In the file, surround each <path> tag with the <symbol> tag with the values of the following attributes specified:
id: Specifies the ID of the icon. The system finds the icon to render it by this ID. The value of the attribute is also used by the system to create the icon name displayed in the modern UI (when you select the icon for a new workspace or a new tile in Menu Editing mode of the modern UI). The system replaces underscores in the value of id with spaces to create the icon name for the UI.
Note
You can include multiple <symbol> tags with different values of the id attribute in one SVG file. For example, you can place multiple icons in one SVG file if all these icons are supposed to be used for the tiles of one workspace. This will speed up the rendering of the workspace.
viewBox: Defines the coordinates for the icon. The viewBox must be square (such as viewBox="0 0 24 24"). You can cut the viewBox attribute from the <svg> tag and paste it to the <symbol> tag. If you have multiple icons in one file, make sure you have the correct values specified for each icon.
The following code shows an example of an SVG file with the necessary changes made.
<svg xmlns="http://www.w3.org/2000/svg">
<symbol id="my_icon" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z"/>
</symbol>
</svg>
NoteYou do not need to use any other tags (such as the <use> or <style> tag) in the <svg> tag. The icons are referenced and filled in with the colors of Acumatica ERP automatically.
Place the SVG file in the Content/svg_icons subfolder of the site folder.You can now use this icon in the application in the same way as you use the default icons. For example, you can select this icon for a new workspace or tile in Menu Editing mode of the modern UI.
To Replace the Default Icon with an SVG icon
To replace the default icon with an SVG icon, follow the instructions above, and as the value of the id attribute of the <symbol> tag, use the name of the default icon that you want to replace. For example, if you want to replace the icon for the Finance workspace, use id="balance-scale". Note
You can find the name of the needed default icon in the MUIWorkspace table of the application database by the name of the workspace: The Title column contains the name of the workspace; the Icon column contains the name of the icon.
During the rendering of the modern UI, the browser will use the icon from SVG instead of the corresponding default icon.

Related

When using Vuetify and importing icons with CDN, is there a way to control the stroke width of the svgs?

I am importing tabler icons in a cdn in my public html folder:
<link rel="stylesheet" href="https://unpkg.com/#tabler/icons#latest/iconfont/tabler-icons.min.css">
and per the Vuetify docs bringing in the icon library (in plugins/vuetify.js):
export default new Vuetify({
icons: {
iconfont: "ti",
}
This allows me to use <v-icon>ti-pencil<v-icon> (as example) in Vue2 components. All of this works just fine. However, when the icons are inside of the <v-navigation-drawer> they are larger and the lines are little too thick. I have only seen the size property that works, but it also shrinks the icon, which is not what I want.
Is there a way to change the stroke width on the svgs with css? Or is there another way to affect the thickness of these paths after being imported? Also adjustments to font-weight are possible but sadly have no effect on the element.
Thanks in advance for any help.
You need to target the icon with Css selectors and adjust the font-weight
Take a look at this codepen.
If you are dealing with Svgs, you can play with viewBox="0 0 24 24" values and change their value!(Which is not recommended)

Why is my icon not centered in the svg preview?

I try to make custom icons for an app. I use Illustrator to create compound paths. Therefore I use FontAwesome-Pro.5.13.0 icons. When I export my custom icons in SVG format they seem to have a different padding (see the picture below). Left is the exported icon which has the same compound path as the right one. The only difference is that I exported the FontAwesome to svg.
Anyone got an idea what's happening?

Printing wide SVG image with embedded PNG/JPG

I'm struggling to find a way of printing a wide SVG image. This is a common problem so let me explain my specific problem.
The image is wide and so I need to tile it (poster fashion) across about 5 or 6 A4 sheets (actual count not important). My first problem is that the default Print dialog in my Firefox or Chrome browsers, under Windows, do not allow me to scale the image height to fit the page height while also spreading the image width across multiple pages.
Someone else suggested using Inkscape to convert to PDF format as the Print dialog in Acrobat reader has better support for tiling. Well, it does, but Inkscape does not deal with embedded images (e.g. PNG or JPG). Worse still, it generates huge square error markers saying "Linked image not found" all over. These are also preserved in the generated PDF which makes it useless.
There are lots of online tools that claim they can convert SVG to PDF. I tried a handful and none coped with embedded images. They were simply discarded.
So, I'm basically looking for any route to print a wide SVG image onto a horizontal series of pages, and that preserves any embedded PNG/JPG images.
[Edit]
Some of the online results:
zamzar -- images discarded
cloudconvert -- simply used inkscape
convertio -- best of the bunch, but opacity ignored on images
online-convert.com -- images discarded
pdfresizer -- simply used inkscape
freefileconvert -- simply used inkscape
onlineconvertfree -- failed with basic SVG
pdfaid -- massively failed with basic SVG
[Edit 2]
Here are a few lines of code that show one of the embedded internet-based PNG references. This one is designed to provide a faint background image underneath the subsequent SVG shapes. Hence the opacity of 12%.
<defs>
<pattern id="img2" width="50%" height="100%" >
<image xlink:href="https://clipartart.com/images/tree-branch-clipart-png-4.png" x="0" y="0" width="50%" height="100%" />
</pattern>
</defs>
<rect width="100%" height="100%" fill="url(#img2)" fill-opacity="0.12" />
I've had time to experiment with this further (and so wasting printer paper by the shed-load).
1) Inkscape deliberately does not support Internet image references (e.g. http) for "security reasons". As mentioned, it puts a horrible error marker in the view of the loaded SVG and I have found no way to edit it out. Hence, it gets saved in any PDF version.
2) If I download local copies of the images and change their http:// references to equivalent file:/// (yes, 3 slashes) then they are accepted.
3) This allows a PDF copy to be saved, but if any of the images had an opacity (e.g. a background image) then that gets lost and it is full opacity in the PDF. This may be a conversion issue or a PDF limitation -- I do not know.
4) Since I then have local copies of the images, they can be changed to implement any faintness required "at source".
5) The Acrobat Print dialog has a Poster option for tiling the pages of a wide image. Ensuring no 'cut marks' or 'labels' are added, you can set a 'Tile scale' that keeps the height within one page, and it will spread it over as many pages as necessary for the width. On the basis of the scaling, it selects landscape/portrait itself and ignores any selection of your own.
So, problems? Yes, the Acrobat 'Overlap' setting is a mystery, leaving a thin white margin on either one or both of adjoining sheets in the output. I have not been able to correlate the width of this margin, or the appearance on one or both sheets, with this setting.
Via the Preferences button, I can get to the normal printer preferences dialog, where I can request 'Borderless printing'. Rather than fixing the issue, this just makes the correlations even more mysterious.

SVG styling not applying in illustrator

I'm generating an SVG in a web app and allowing users to save it; the SVG embeds the styles in the header of the image.
When a user opens it in their browser (testing in Chrome) it style properly:
However in Illustrator it seems the styles aren't being applied:
What am I missing? Download the actual SVG here.
The problem is really with Illustrator's SVG importer.
You probably have to choose between two solutions:
Tell your users that saved SVGs won't work with some programs (like Illustrator)
Modify your graph generating code so that it doesn't rely on CSS classes.
For example: change the elements that use
class="link"
To instead set the style properties explicitly:
fill="none" stroke="#aaa" stroke-width="2px"
Or maybe you can find a script on the net somewhere that does that for you.

Inconsistence between SVG file and Android Studio vector asset

I'm using the Sketch software to build svg images to use in my android project. I'm having an issue with this one:
As you can see, the picture is ok and I checked the previews with Chrome and the Macos preview.
When I try to import the SVG in Android Studio the import preview is the following:
The subtracted circles inside the filled ones are gone. The import log messages me this:
In ic_percent.svg:
WARNING# line 10 We don't scale the stroke width!
WARNING# line 11 We don't scale the stroke width!
WARNING# line 12 We don't scale the stroke width!
WARNING# line 13 We don't scale the stroke width!
Does anyone know what is happening with my import?
I had similar issues when importing a .svg file made with Inkscape. It seems that some attributes are just not supported by the Android Studio importer.
The easiest way I found is to use svg2android. Not sure how it handles Sketch .svg but it seem to do the trick with files from Inkscape.
If someone else uses Inkscape don't forget to set your document size to your vector size "File -> Document Properties..." or just edit it directly in the file with a text editor.
Short answer: Ungroup everything you have in your SVG, make sure you don't have layer transforms and resave.
Long answer: Every stroke has width, it is numeric and encoded in SVG as
<path style="...;stroke-width=1.5;...">
At the same time every stoke is an object and objects can be grouped for the sake of editing ease. Groups are objects also, thus can be grouped so that groups can have nested groups.
Whats most important, groups have transformations, that are created when you move or scale or rotate grouped objects (e.g. paths) in your vector editor and that are encoded in SVG as
<g transform="...">
<path .../>
<path .../>
<some other object .../>
</g>
The "transform" attribute can be either a "matrix" or a sequence of linear transformations like "rotate" or "translate" or whatever, it does not matter in this case. All transforms of a group are applied to all contained object properties.
So group "transform" is applied to the contained path "stroke-width".
This is exactly what Android Studio does not support.
The solution is simple: Ungroup all the groups and force vector editor to apply transformations to the real geometrical objects. Then export again.
There still will be groups in the resulting file, that's fine - it's the only way to store layers in SVG. Just make sure layers in the file do not have transforms applied. Most probably you will not have to do anything for this, as vast majority of vector editors can only have visual and not geometry effects on them.
That's it.
Example of a piece of very simple file that will break Android Studio import. This is just two random strokes, grouped and scaled with mouse:
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<g
id="g821"
transform="matrix(0.74621726,0,0,1.3160501,48.238048,-10.434556)">
<path
inkscape:connector-curvature="0"
id="path815"
d="m 58.964284,69.458334 31.75,-5.291667"
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
<path
inkscape:connector-curvature="0"
id="path817"
d="M 77.863093,95.160713 112.6369,77.017855"
style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
The same piece after ungrouping that is fine for Android Studio:
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:none;stroke:#000000;stroke-width:0.26219916px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 92.238214,80.976091 115.93061,74.011993"
id="path815"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:0.26219916px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 106.34083,114.80171 132.28965,90.9248"
id="path817"
inkscape:connector-curvature="0" />
</g>
Here's how:
Open your .svg in sketch
Select that missing Circle in Page List. In my case, it's looks like this.
Click Fills (Gear shaped icon) and change Even-Odd to Non-Zero
Open Layer menu -> Path -> Reverse Order
Export the shape back to .svg format
Convert that .svg to Vector Drawable (from Android Studio or 3rd party tools)
That's it! Credit to #dineshbob medium blog
In Inkscape you can select lines a.s.o. that use stroke width and convert them to path before saving as sgv:
I had the same problem when I exported my vector graphics in svg format.
But Android studio can also handle the psd file format when importing vector graphics. After I set the file format to psd during export, the import into android studio worked fine for me.
I had the same problem using inkscape. Not sure if would work with Sketch, but is simple to try it out.
Just start a new Sketch project and paste your vector from the previous one. This solved my problem with the same situation on Inkscape. It seems some extra properties used during creation of the picture are not welcome in android's import tool.

Resources