How to render ₹ symbol in PDF in C# using PDFsharp - winforms

I want to render ₹ in PDF using C#.
Instead of this I am getting ?.
In form am able to print how to render ₹ but I am facing this issue only with PDF.
Attached image

Make sure Unicode is enabled in PDFsharp and also make sure the font use are using contains that symbol.
Since you get "?" instead of the symbol, you most likely just have to set the PdfFontEncoding.Unicode option as shown in the sample.
See this sample:
http://pdfsharp.net/wiki/Unicode-sample.ashx

Related

Formatting Text Area will not format when using Advanced Custom Fields? Delivered using GraphQL

I am trying to format the content of 'Text Area' when using WordPress's Advanced Custom Fields. I am using React to build the project.
In an attempt to debug, I have been following this documentation and set my options to resemble the image referenced. Including Text Area as one of my custom fields and setting the New Lines option to Automatically add paragraphs
The documentation then goes on to show an example using PHP to render the content.
I am using graphQL to fetch my data, and delivering the contents as follows:
<div className="media-description-area">
{this.props.activeDescription}
</div>
with activeDescription being destructured from the object that the GraphQL request delivers.
The text as its being set in the field itself looks like this, with spacing included:
The formatting tags are being rendered directly into the string itself, this how it is appearing in the document:
Does anyone know how why this is? I am referring to the field directly so it appears as this formatting is being delivered from WordPress itself
activeDescription: objects[0].items[0].projectDescription,
Thank You

How to save codes on VS Code Mac?

I am using VS Code on a Mac to write ReactJS, however I find that I could not save my code. If I use command and s to save, then the JSX will be a mess, just like shown in the picture:
enter image description here
So how could I solve it? Thank you
I think your code is being saved, but that your code formatting is messing-up your code.
Hit the following combination : Shift+Command+P
This will open a menu on top. Inside that menu type Format Document With..., and select it. It will allow you to format your code with a different auto-format tool. Choose the one that is appropriate for your code i.e. Prettier.

Liferay 7.1 npm-react-module localization

I'm trying to include localization into my npm-react-module, but I have failed receiving the value for the corresponding key from the Langugage.properties file. It simply returns the key. I did some research but I couldn't find any source that would help me solve my problem.
In the code which I will show you bellow, I have included a Language.properties file into my module. In my portlet, I have included the needed configuration for the language properties. I have also tried to add a separate file for a specific locale, but that didn't help me either.
This is an example of my portlet configuration:
"javax.portlet.resource-bundle=content.Language"
This is an example content from my Language.properties file:
example-key=example-value
This is how I'm trying to access the value in my React Component:
<h1> {Liferay.Language.get('example-key')} </h1>
But it only returns "example-key" instead of "example-value".
In my view.jsp file I am able to retrieve the corresponding values using
<liferay-ui:message key='example-key'/>
I have tried this method: https://portal.liferay.dev/docs/7-1/tutorials/-/knowledge_base/t/localizing-your-portlet but it didn't work either. Did anyone get this to work properly in their npm-react-module? I really don't want to spend time implementing my own localization service. Thanks!
Liferay.Language.get('key') gets text replaced by the build mechanism. Therefore there is no actual object/class to do this. I have been trying to get this to work myself and have resolved that I will have to do internationalization on my own.
localizing is done only in build time meaning if you have a language
key that generated dynamicly , you can't localizate it or for example
if you get a key from api fetch and need to localizate it, you can't
beacuse Liferay localization method for react (
Liferay.Language.get("yourLanguageKey") ) its undefined in runtime and
you can't use it.
from: https://npm.io/package/liferay-react-runtime-localization

Setting SSRS BackgroundImage Source from field

I'm working on an SSRS template at present which pulls lots of its format information from a database. Part of this format information sets the Background Image of cells.
I'm currently filling the image by setting the Source to External and pulling its value from the database. This works lovely, however It means pulling the image from a network source each time and while a small efficiency hit, I'd like to try and remove that pull if possible by embedding the standard images.
Again this works fine, I can pull either an external image or an embedded image and display on screen. The problem comes when I'd like the option to do either.
I find that I cannot set the image Source from a field, there isn't an option in the GUI.
I've tried going into the code and entering the details there but I get a validation error:
The 'http://scemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition:Source' element is invalid - The value =First(Fields!bodyBackgroundImageSource.Value, "dsTemplate") is invalid according to its datatype String - The Enumeration constraint failed".
Has anyone else come across this and found a solution or know of a workaround? I can continue using only external images, but would prefer to avoid as many external calls as possible.
In our local environment, we tested this scenario and if the expression can return the correct image name, then the image can display properly. You can check if the "First(Fields!bodyBackgroundImageSource.Value, "dsTemplate")" expression return the image name existing under Images folder on Report Data window. And make sure the image source is embedded.

PDF to text extraction using Poppler C API

I need do extract the text from the PDF file.With the help of Poppler API i can able to extract all text available in that page . even i can able to get the font information like Bold and italic .But i cant able to get the size of the text.Please let me know the way to get the size of text.
Thanks
Although late by an eternity, take a look at TextWord::getFontSize().

Resources