Generate PDF from a view but content is not in English - asp.net-mvc

I'm trying to generate a PDF doc from mvc4 view but none English characters do not display or display as gibberish(for English it works fine).
I tried to use pdfRazor and itext but only English chars are shown on screen. I'm open to any solution even for generating string from the view and then render PDF (that also didn't work for me).
If anyone was able to genrate pdf from mvc view please please let me know.
I guess the issue with itextsharp is the basefont - i don't mind using other solution.
Thanks!!!

You can create PDF with mixed English and Hebrew characters , for this you need to specify the font.(you can downlaod the font files and keep it in your in your application)
check the below link, you can use the code lines in the samples
java itext create pdf with hebrew (rtl) and english
My Hebrew Text in iText is left-aligned
http://itext-general.2136553.n4.nabble.com/How-to-display-Arabic-td3400141.html
Change direction of written text for Hebrew letters iText

Related

How to use non-English characters in Godot?

I want to use non-English characters in Godot, but when I write them (In every node, like a Label or a Button) and run the project, the text does not display. For example, I write some Arabic characters in a Label and run the project, but I do not see anything. But I can see the characters in editor separately and reversely. ("عالم" is displayed "م ل ا ع")
I know that this problem is discussed on GitHub, but there was not any good solution. Please advise me a good and simple solution to solve this problem. I think it is not solved so far.
The default Label font in Godot doesn't support non-ASCII characters.
You can try to change the font in your Label node to one that supports non-ASCII symbols by picking a font from your computer, or if it doesn't exist on your device, uploading it from some site like Google Fonts, and choosing an arabic-supporting font, like Amiri.
After choosing the font for your Label node, open the Custom Fonts property in the editor of the node, and create a DynamicFont, and in Font => Font Data press Load and choose your font in the opened window in the file system (.ttf or any another font extension).

Menu is not showing pdf file- pdf Annotation in iOS

I am developing the app like ibooks by reference,in that the pdf is not enabling the menu i.e while I long tap the pdf it not showing Menu like copy , define.
How can I work in menu? Help me.
The linked solution simply does not implement text selection or glyph coordinate extraction/conversion. You need to parse the PDF page content stream and track glyphs on the page. CGPDFOperatorTable can be a starting point, however I suggest reading the PDF spec and getting familiar with the multiple transformation matrix states that a page can have - it's quite tricky to get right. You also need to embed various CMaps (character maps) so that all fonts can be correctly parsed. It took me more than a year to get a reliable text extraction for >99% of all PDF documents. If you want to save this time, you can check out the commercial PDF SDK I am working - google for PSPDFKit. We support iOS and Android.

PDF annotation highlight & search text

How to play with the PDF document in ios?
I have to perform some operations on the PDF document like - read the PDF document, Adding annotations to PDF, making note on PDF, Search text in PDF, highlighting the text in PDF document.
How this can be achieved? Can anyone please suggest me a sdk or tutorial? (Except PDFKitten...)
I know it is old question but since iOS11 you can use PDFKit.

iTextSharp - Pre filled Chinese characters in PDF do not come visible until textfield is focused

I am creating PDF with pre filled values in Chinese but when opening the PDF all the textfields containing Chinese text are empty. When focusing a textfield the Chinese text comes visible but is hided again when unfocusing the field. What could be the issue?
Please share some more info, as there could be more than one reason why the appearances aren't generated by iText.
A. The first reason is explained in the StackOverflow question "AcroForm values missing after flattening". In this case, the PDF contains a parameter that instructs iText not to generate appearances, which would explain why you don't see any value up until you click the field, in which case the viewer will create them.
B. The second reason is explained in section 8.3.3 (entitled "Text fields and fonts") of my book. In this case, the parameter in the PDF doesn't prevent the creation of field appearances, but iText fails to do so because you're not providing a font that knows how to display the Chinese characters.
See for instance figure 8.3 and 8.4 of the book.
In figure 8.3, you see that Chinese text isn't displayed in the upper window. By fixing the form (using two different strategies), the Chinese text appears in the lower two windows. Note that the Chinese text won't appear in all viewers in the case of the middle window.
In figure 8.4, you see that Korean text isn't displayed in the upper window, nor in the third window. In all other windows, different strategies were used to fix this problem:
It would lead us too far to discuss all the different strategies in an answer on SO. Instead, please take a look at the TextFontFields example (for the C# version, please take a look at the ported examples). My guess is that you'll benefit most from the AddSubstitutionFont() method, provided that you use a font of which a subset will be embedded in the document (in the example arialuni.ttf is used).
In case of A., the phenomenon also concerns other languages. In case of B., the parameter is correct, but you're not providing a font that can be used to generate the appearance.

Special characters not displaying, sifr r436

I followed the explanation on the sIFR wiki, but can't seem to get accented characters to display in my Flash movie. I opened up the Character Embedding palette, pasted "ÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ" into the "Include these characters" field after the ampersand, hit "OK", then re-exported the .SWF.
The characters still don't render in my sIFR file--any suggestions? I'm running r436.
have you tried checking the 'Basic Latin' or 'Latin I' boxes (just for sanity check?)
I've just looked through mine and I use 'Latin I'.
could be that the encoding between the webpage/javascript and flash isn't picking up the special chars - have you debugged your javascript to see what's being passed in?
[edit] what is the webpage encoding set to?[/edit]
Perhaps the font you're using just doesn't include those characters? Frequently, fonts will support just ascii.
As jeremy said, the major issue i've seen with sifr and charecters is that special charecters aren't part of the font you are using.
One way to test is run your current method with another standard font such as arial, if it works then it's probably down to your font.
What font is it?
Secondly when making the font glyphs inside flash you have to change the settings to include any foreign characters to insure they are within the font flash movie. most none standard characters are removed as it keeps the file size of the swf font file down.
Unicode escape sequences?
or maybe check a url encode chart
when you view the generated source (below) you'll see that the chars are being encoded by javascript...
content=This%2520is%2520an%2520embedding%2520test%253A%253Cbr%253E%25C3%25C4%25C5%25C6%25C7%25C8%25C9%25CA%25CB%25CC%25CD%25CE%25CF
can you switch on HTML on the text field to see if they show up?
Checking Latin I was mentioned, what about Latin Extended A, Extended B and Add'l? Cmd+clicking Punctuation, Basic Latin, plus all of the other Latin options may get you your missing characters.
I suspect its a problem with Flash. If I go to your example page (http://unstoppablerobotninja.com/demos/sifr-encode/), right-click on the Flash movie, and copy to the clipboard, this is the output:
This is an embedding test:
ÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ
Did it work?
Which to me indicates that the characters are ending up just fine in the Flash movie, but they're not being rendered.
Can Flash render these characters if you use static publishing for some other Flash movie?
I have the same problem with a dynamic text field not rendering special characters, despite the field being set up correctly and the specific characters required being embedded in the field.
I noticed that HTML source text which is formatted to appear as Bold (i.e. using tags) creates this problem - the same text without Bold results in the special chars being rendered correctly (although obviously not in Bold :)
I tried various things including using the unicode reference and exporting the Bold variant of the font (Verdana) but nothing helps, so I think it's a Flash bug.
Of course, knowing this doesn't solve the problem if you need to use a Bold font, like I do - I'm still looking for solutions and will post back if I find something.
Good luck ;)
Solving the Bold issue is easy. Special characters not appearing is another problem entirely and one in which we are encountering currently.
Here's the deal with bold (and italic):
If you use bold or italic tags in the HTML, Flash has not necessarily embedded the bold and italic version of the font. What you have to do is create some hidden dynamic text fields that have the bold and italic versions of the font embedded. These hidden text fields can be placed in a frame past the end of the timeline so that they don't appear at runtime.
A related problem is when you click the B (for bold) in the properties panel and insert HTML text into the textfield without a <b> tag. Flash will embed the bold font into the SWF, but if you don't insert the <b> tag in your text, Flash will render it with a non-bold font (which won't appear because it wasn't embedded).
Unfortunately, we have a situation where a dynamic text field was created with one font, and if we change it to any other font, it doesn't render. Special characters, such as the ® symbol, don't render, even though they are embedded in the font.
This is with Flash CS3 and AS2.

Resources