Can we fill chines text(Not the unicode) into acrobat form and then flatten it using iTextPdf? - itextpdf

Can we fill chines text(Not the Unicode) into acrobat form and then flatten it? if yes can you please provide me the sample code? and steps ?

Related

Data Matrix 2d barcode and fusion pro

I'm in a bit of a stump. Not sure how many people here are familiar with the plug-in "Fusion Pro" for Acrobat but maybe it doesn't matter.
I need to create a 2d Barcode and have it read data for 3 or more columns in excel i.e.: A, B, C, D
As said earlier, I've been creating these barcodes through fusion pro and it's called a "DataMatrix" does DataMatrix imply that the barcode is 2D or are the other different names that 2D barcodes can have?
Thank you!
ALSO: If you have a solution for this through another software please don't hesitate to mention that. I'm not bounded to just use FusionPro.
DataMatrix does imply 2D barcodes. There are several encoding strategies for DataMatrix and other 2D barcodes (QR Code and PDF417 are two highly popular ones). What you want to do is "Tab-delimit" your data, so Excel puts the fields in different columns. That means embedding the ASCII control character HT (for horizontal tab) in between your fields.
Each of the symbologies has a method for embedding control and escape characters in the data portion of the barcode and I would like to think that the barcode generator - Fusion Pro, in this case, would have some mechanism as well.
You may need to embed a CR (carriage return) or LF (line feed) or both at the very end of the data to get Excel to accept the input and automatically move between lines, or you may have to scan into notepad, then import to Excel.
Check out https://en.wikipedia.org/wiki/Data_Matrix for details on data encoding.

How can convert Maple formula to Mathtype format

as you know when working with Maple each equation you typed with maple format will be seen like as mathtype after calculation with default blue font, for example you type QK:=Matrix(3,3,[Q[1,1],Q[1,2],0,Q[2,1],Q[2,2],0,0,0,Q[3,3]]); and you see this in the matrix format with subscript of each member of matrix. If you want to send this output to MS word software you got the picture of equation that can not edited or formatted like as mathtype formulation.
the question is how can I convert Maple output calculation to mathtype format?
I have found MathML formulation editor but when copy maple output on it, it can show formulation only in the plain text format that can not calculate or convert to the mathtype format.
Thanks, find it!
at the first step right click on Maple output and select special copy and select copy as MathMl and paste it on the Formulator editor. at the second step copy the available formula in the Formulator and paste it on the Mathtype. the result was excellent for formula that dont have any Greek character, but if Greek character is available in the output formula, the result in the Formulator substitute this character with english spell with & sign at first and ; sing at the end. I want to find solution for this problem as example β change to &betta;
It seems you have discovered the answer that we (Design Science) have on our website: http://www.dessci.com/en/support/mathtype/works_with.asp#!target=maple. One issue with Maple's MathML when pasted into MathType is the attributes it adds to the markup. For example, this is the MathML output from Maple for the variable x:
<mi mathcolor='#0000ff' color='#0000ff' fontstyle='2D Output' fontweight='normal'>x</mi>
Those 4 attributes help to replicate the look of the math as displayed in Maple, but they're unnecessary in MathType and most anywhere else you may paste the MathML. It doesn't take long before all these attributes contribute so much overhead that MathType simply can't handle it. (MathType thinks it's taking so long to interpret the MathML that surely it's in an infinite loop -- and gives an error.)
The problem with the Greek letters from Maple is that what should be a single character ampersand – & – comes out in the MathML markup as the entity for ampersand: &. It would be great if MathType could just look at that and think "Hmm. Ok, I'm pretty sure Maple meant just &, so I'll assume that." But it doesn't.
Let M be maple form. For finding latex form you can use this commend:
latex(M)

Parsing PDF files

I'm finding it difficult to parse a pdf file that's created in a non-english language. I used pdfbox and itext but couldn't find anything in there that could help parse this file. Here's the pdf file that I'm talking about: http://prapatti.com/slokas/telugu/vishnusahasranaamam.pdf The pdf says that it's created use LaTeX and Tikkana font. I have Tikkana font installed on my machine, but that didn't help. Please help me in this.
Thanks, K
When you say "parse PDF files", my first thought was that the PDF in question wasn't opening in various PDF viewers & libraries, and was therefore corrupt in some way.
But that's not the case at all. It opens just fine in Acrobat Reader X. And then I see the text on the page.
And when I copy/paste that text from the first page, I get:
Ûûp{¨¶ðQ{p{¨|={pÛû{¨>üb¶úN}l{¨d{p{¨> >Ûpû¶bp{¨}|=/}pT¶=}Nm{Z{Úpd{m}a¾Ú}mp{Ú¶¨>ztNð{øÔ_c}m{ТÁ}=N{Nzt¶ztbm}¥Ázv¬b¢Á
Á ÛûÁøÛûzÏrze¨=ztTzv}lÛzt{¨d¨c}p{Ðu{¨½ÐuÛ½{=Û Á{=Á Á ÁÛûb}ßb{q{d}p{¨ze=Vm{Ðu½Û{=Á
That's from Reader.
Much of the text in this PDF is written using various "Type 3" fonts. These fonts claim to use "WinAnsiEncoding" (Also Known As code page 1252), with a "differences" array. This differences array is wrong:
47 /BB 61 /BP /BQ 81 /C6...
The first number is the code point being replaced, the second is a Name of a character that replaces the original value at that code point.
There's no such character names as BB, BP, BQ, C9... and so on. So when you copy-paste that text, you get the above garbage.
I'm sorry, but the only reliable way to extract text from such a PDF is OCR (optical character recognition).
Eh... Long shot idea:
If you can find the specific versions of the specific fonts used to generate this PDF, you just might be able to determine the actual stream contents of known characters converted to Type 3 fonts in this way.
Once you have these known streams, you can compare them to the streams in the PDF and use that to build your own translation table.
You could either fix the existing PDF[s] (by changing the names in the encoding dictionary and Type 3 charproc entries) such that these text extractors will work correctly, or just grab the bytes out of the stream and translate them yourself.
The workflow would go something like this:
For each character in a font used in the form:
render it to PDF by itself using the same LaTeK/GhostScript versions.
Open the PDF and find the CharProc for that particular known character.
Store that stream along with the known character used to build it.
For each text byte in the PDF to be interpreted.
Get the glyph name for the given byte based on the existing encoding array
Get the "char proc" stream for that glyph name and compare it to your known char procs.
NOTE: This could be rewritten to be much more efficient with some caching, but it gets the idea across (I hope).
All that requires a fairly deep understanding of PDF and the parsing methods involved. But it just might work. Might not too...

How do you save a plot in Octave 3.0.5 if it has latex in it?

My school has Matlab but I can't use it at home so I am trying to learn Octave. I am having trouble saving plots as png files so I can put them in a report.
I read you can use print("filename.png") to save the plots, but I am getting some kind of error I am assuming is due to using latex in my labels
I am using
xlabel('\omega')
Error message: gdImageStringFT: Could not find/open font while printing string w with font Symbol
The plot still saves, but any label with latex in it just doesn't print at all. I know I could just avoid formatting the text, but it just looks so much nicer with latex.
Anyone know what I can do? (ps I am not very advanced with linux just fyi)
So what happens here is that for the png format Octave needs to have the Symbols font at its disposal if you want to include, e.g., greek letters. This is because png is a bitmap format and the letters are rasterized and printed into the picture.
The correct way, or at least the way most people circumvent Octave's / Mathematica's / etc. poor labeling, is to output encapsulated postscript (.eps) with dummy labels. These labels are kept separate in the eps format and one can then use the psfrag package in LaTeX to replace the dummy labels for correct labels. This allows for much better control over the label and gives you access to all of LaTeX's formatting and formulas.
Here or here is a hands on tutorial how to do this with Octave and gnuplot.

Best Way to Automate Adding Text to an Image and formatting for Printing?

Here's what I have:
Quarter Sheet Flyer (4 per page) as a PSD or JPG
Text file with one entry of text per line.
What I want to do:
Print out 100 flyers (on 25 pieces of paper)
Somehow automate the process of adding the text to the image, either via some scripting language or a Photoshop automated task. Then format the pages to print, either to generate a 25 page PDF file or generate four at a time and send them to the printer page by page.
Anyone have any experience with something like this or have any recommendations on how I should go about doing this?
Thanks for your help!
You can use Microsoft Word automation to generate a word file with the correct text and image, and then just print it.
This would be one of the simpler solutions, you can implement the entire thing as a word macro (VBA).
A more complex solution would be to use VB6 or .net to print the text and the image into the form and then print the form.
You can write a script that will generate an html page with the image and the text, and then print out the html using a browser.

Resources