I'm developing an UWP app in C#. It needs to support both English and French and the first screen contains a FlipView bound to JSON data.
How could I localize the text content inside this FlipView?
I have thought of multiple ways:
In the JSON, add translated fields for each view. This means I'll need to retrieve the current language and change the way I parse the JSON according to it.
Do another JSON and choose which one to parse according to the language I retrieve.
What would you do and what is the most efficient? Is there another way? As I'm already using XAML resource files to translate other UI strings. If there is not, is there a way to retrieve language information in C#?
Thanks.
well there is not easy way to solve your problem.
You will need translate the words of your json manually but I recommend you to use Bing Translator Api is very easy to use.
you can send your word to be translated to another language ans show the result in your UI
https://www.microsoft.com/en-us/translator/getstarted.aspx
Finally I just made it so that there is a JSON file for each language. I then switch the file according to the system language at load time.
Related
I am creating a template for a CV. It is stored in a database table as an image with format VARBINARY(MAX). I am going to load them to Winforms to be able to add labels on the template and fill the information in the labels. The information for the template is saved in another table of the database.
Now I need to fill the information on my templates using winforms and then save them on the device by choosing a PDF from the dialog bar.
What can I use for doing this? Is there any tool which can help me doing so?
You are asking quite a few different questions here, without giving too much detail. I'll try to give some guidance, but without a lot more detail, it's hard to be specific.
First, the question doesn't have anything to do with WinForms, what you are asking would be the same in pretty much any approach, so I'll ignore WinForms.
If you have the template in a database table, presumably as plain text (which could of course be HTML, PostScript or any other markup language) with placeholders, and you have the data in another table, then you can simply merge the two together to produce the CV in plain text.
Once you have the merged CV, converting it to PDF is best done with a library. It's not the sort of thing you want to try doing yourself. Which library you use depends a lot on your requirements and budget. There are one or two free ones, but I can't say how good they are, as I use a commercial one. I'm not making any specific recommendations here, but a bit of searching and experimenting should get you what you want.
Hope that answers you questions. If not, please edit your question to include more specific information.
I want to do below task using iText7.
create template using HTML or ..(some fields can be able to hide
according to user input)
Fill the template with the database data
generate accessible pdf
How can I do this?
As far as I understand, you want to have an HTML template where you will fill in data based on user input as well as data coming from your database. This is possible in iText in general, however you would need to do a lot of work, especially if you want to have a template for the PDFs that you are going to generate (as well as the template for the HTML form for capturing data).
It would be nice to have a tool where we design the HTML form and the form with which the output PDF is going to be generated interactively and maybe even using the same resources, sub-forms, sub-templates etc. Then the only thing the technical person would do is to bind the actual data to the form elements. The template will have the logic to show/hid elements or any other conditions that you might come up with. It would simplify the workflow a lot.
iText is working on a product called Dito which was announced in GIDS 2018 in Bangalore, India and a demo session was given. Dito is going to do exactly what you want and what I describe above. You can find the presentation here: http://www.developermarch.com/developersummit/downloadPDF/Dito.pdf
You can find also document workflow here: https://itextpdf.com/sites/default/files/attachments/LL_iText_Infographic_Flyer_A4-pdf.pdf
My application require 2 different asia language support: Chinese and Tamil.
It should be able to cater for change without compiling, something like java's resource bundle.
In this case, if I input unicode on a external file and get silverlight to read as string, will silverlight be able to parse it correctly?
Or I can use the chinese/ tamil characters directly in the external file, but I'm not sure how to retrieve these characters in code.
Anyway these language will be shown on the same screen, so I don't think localization will help.
Just place the content in Xml (probably Xaml Resource dictionary) using the default UTF-8 encoding.
I'm trying to create a web script that will allow me to alter PDF templates that I have uploaded and re-output them. I have tried Zend already which allows me to write to a PDF but that means leaving the PDF blank in certain space which is to primitive for what I need. PDFFlip was not any better.
We need to implement functionality so we can remove content from the PDF as well as remove and replace. I have looked at CAM::PDF and changepagestring.pl but I'm not sure it's up to the job. I was hard pressed to find any real usage examples and Perl is not a language I have used before.
This is for a web project but I am flexible with the language we use, ideally PHP or ASP.NET C# would be great. Preferably not Java unless there is no other way.
I should also point out that I looked through the FoxitReader SDK without any luck. I never tried to implement it but I found no mention of find and replace like functionality.
You can tinker with PDF text but it is not straight-forward just to search and replace. The text is designed as an end-file format not for easy editing. I wrote a blog post explaining some of the issues at http://pdf.jpedal.org/java-pdf-blog/bid/12670/PDF-text
May be as workaround it's better to hold and fill in templates in some format that is more convenient for editing? E.g., you can keep your templates as Microsoft Word templates and then export them to PDF after filling. This thread may be useful on this way.
PDF file format isn't quite appropriate for editing.
Alternatively, you may prepare your templates as PDFs containing form fields. In this case filling of form fields is common and well-known task and there a lot of pdf components for this.
Is there a tool to take a GUI designed in C# or other languages that can take the screen layout and export that to an XML file such that you end up with a template of the screen in XML terms? As well as take an XML file and display the resulting screen?
Have you investigated XAML in WPF? You mention C#, so it seems like this is directly in line with what you're asking about.
http://en.wikipedia.org/wiki/XAML
Another good jumping off point might be this:
http://en.wikipedia.org/wiki/List_of_user_interface_markup_languages
XAML and XUL are designed to work in precisely this way. QT and Glade also offer this facility. However, they do not (as far as I know) offer any facility to reverse engineer a GUI that was not created with the layout tooling.
To use this type of tool you have to go from the form designer, which will save the form as a descriptor file. The toolkit will then offer various means (the exact method varies with the toolkit) to load the descriptor file and render the screen from it or use the descriptor as input into a code generator.
There is java.beans.XMLEncoder/XMLDecoder. But if you want to do that sort of thing, I think you are misguided.