Putting CJK text into PostScript file
Our application, as one of several export options, generates PostScript files. We recently added support for UNICODE text to the application - all internal text is utf16. I am having trouble exporting asian (CJK) fonts correctly. Before the switch to UNICODE we supported ShiftJIS for Japanese. I know that PS does not directly support UNICODE. So, my question is, what is the best way to proceed given the facts that I have UNICODE text and I must generate a correct PS file which will display that text?
To my pea-sized brain, it looks like there are two possible paths...
1. Convert the utf16 to ShiftJIS (or whatever code page is required) and export as before? This seems doable, but strikes me as a hack since I would need to look at each code point and figure out which code page it is related to.
2. Re-encode the font? But how? I've looked at documentation for CID-keyed fonts and some sample code for re-encoding, but I admit that I have not yet had an aha! moment. I'm not even sure if I'm looking at the correct stuff.
Also, do we need to embed the font(s)? (I realize that CJK fonts can be large, but file size is not a major consideration.)
Thanks for any help.
At this point embedding & reencoding appear to be more advantageous from what I understand of your project.
I have written PostScript drivers that embed Type 1 format fonts by converting the binary printer font (.pfb) file into a 7-bit ascii PostScript file and inserting that in the PostScript output stream. The font just needs to be inserted so that it is available in the context of when it will be used (ie. before font use and same or more significant save/restore level.
I have also reencoded font characters within a PostScript job in order to access special characters that didn't exist in an EBCDIC character table using octal codes, but I'm not sure if this will suit your solution 2 or not.
Code sourced probably sourced from Adobe Developer Kit of many years ago:
/reencsmalldict 12 dict def
/ENC
{reencsmalldict begin
/newcodesandnames exch def
/newfontname exch def
/basefontname exch def
/basefontdict basefontname findfont def
/newfont basefontdict maxlength dict def
basefontdict
{exch dup /FID ne
{dup /Encoding eq
{exch dup length array copy newfont 3 1 roll put}
{exch newfont 3 1 roll put}
ifelse
{pop pop}
ifelse
}forall
newfont /FontName newfontname put
newcodesandnames aload pop
newcodesandnames length 2 idiv
{newfont /Encoding get 3 1 roll put}
repeat
newfontname newfont definefont pop
end
} def
/EVEC [
8#030 /mu
8#031 /eth
8#032 /Yacute
8#033 /brokenbar
8#034 /onehalf
8#200 /Aacute
8#201 /Acircumflex
8#202 /Adieresis
8#203 /Agrave
8#204 /Aring
8#205 /Atilde
8#206 /Ccedilla
8#207 /Eacute
8#210 /Ecircumflex
8#211 /Edieresis
8#212 /Egrave
8#213 /Iacute
8#214 /Icircumflex
8#215 /Idieresis
8#216 /Igrave
8#217 /Ntilde
8#220 /Oacute
8#221 /Ocircumflex
8#222 /Odieresis
8#223 /Ograve
8#224 /Otilde
8#225 /Scaron
8#226 /Uacute
8#227 /Ucircumflex
8#230 /Udieresis
8#231 /Ugrave
8#232 /Ydieresis
8#233 /Zcaron
8#234 /copyright
8#235 /registered
8#236 /trademark
8#237 /aacute
8#240 /acircumflex
8#260 /adieresis
8#265 /agrave
8#276 /aring
8#300 /atilde
8#311 /ccedilla
8#314 /eacute
8#321 /ecircumflex
8#322 /edieresis
8#323 /egrave
8#324 /iacute
8#325 /icircumflex
8#326 /idieresis
8#327 /igrave
8#330 /ntilde
8#331 /oacute
8#332 /ocircumflex
8#333 /odieresis
8#334 /ograve
8#335 /otilde
8#336 /scaron
8#337 /uacute
8#340 /ucircumflex
8#342 /udieresis
8#344 /ugrave
8#345 /ydieresis
8#346 /zcaron
8#347 /logicalnot
8#354 /minus
8#355 /threesuperior
8#356 /thorn
8#357 /twosuperior
8#360 /yacute
8#362 /threequarters
8#363 /Eth
8#364 /onequarter
8#366 /Thorn
8#367 /divide
8#374 /plusminus
8#375 /multiply
8#376 /onesuperior
8#377 /degree
] def
/WE {EVEC ENC}def
/HLN {/HLNWE findfont}bind def
/Helvetica-Narrow /HLNWE WE
Similar Messages
-
When I convert my pdf doc to word, the fonts go really weird and it also puts some text into boxes. when I try to select the text and change the font, it does not change it properly? This is making it impossible to amend.
Hi Janedance1,
If the PDF that you converted already has searchable text, please try disabling OCR as described in this document: How to disable Optical Character Recognition (OCR) when converting PDF to Word or Excel. (If the PDF was created from a scanned document and doesn't already have searchable text, disabling OCR isn't a great option, as the text won't be searchable/editable in the converted Word doc.)
Please let us know how it goes.
Best,
Sara -
How to use OCR Font A type by the time of writing some text into Pdf fil
Hi,
I am generating one pdf file in java. How can I use OCR Font A for text of pdf file ..Please can any one help where can I get OCR Font A and how to use that one in java ... I want to write some text into pdf file and that text should use OCR Font A family ...
Thanks.This document shows how to disable OCR during conversion; just do the opposite: https://forums.adobe.com/docs/DOC-3062
-
OS: WinXP sp3
FF: 3.6.3
I have difficulty pasting text into the file name field (prefix only) while saving files. example: File name is Pic123.jpg and I want to rename it ABC123.jpg and I have ABC loaded into the WinXPsp3 clipboard. When I highlight\right-click\delete "Pic" then attempt to paste the ABC, I get either no reaction, or upon multiple paste attempts, the ABC is appended to the end of the file, after the extension, as "Pic123.jpgABC". If I delete this unwanted suffix, or repeat the process several times, eventually I can delete the unwanted portion of the prefix and paste the desired text. Sometimes it works fine first try, but mostly it takes several tries. I'm using Firefox 3.6.3 but the problem existed in whatever previous version I had too. This issue only occurs when using the delete/paste; I can always manually change the name by typing. Thank you for your help.Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
*Do NOT click the Reset button on the Safe mode start window or otherwise make changes.
*https://support.mozilla.org/kb/Safe+Mode
A possible cause is that the server sends a wrong response header.
The server may not comply to RFC 5987 and sends a wrong Content-Disposition:attachment; filename header.
* https://developer.mozilla.org/en/Firefox_8_for_developers#Network -
How to put a text into a picture package.
I want to print a set of 6 pictures onto a single sheet of paper with a heading on the top. I can do this by exporting all 6 pictures as jpegs, creating a page in my favourite word processor or publishing package and doing it all there.
However, Lightroom 3 allows me to create a page with the 6 photos, but I can't see any way to put a heading on top. Is there any way to do this?
While on the subject, is there any way to put a freeform text label below each picture?
Thanks
TonyIf you put it in a region on page zero, it will be inherited by all pages of the application.. Literally in the upper left corner? Even the login page? You could also modify the template page that your using from your theme, so that all pages would have this attribute, whichever you are more comfortable with..
Thank you,
Tony Miller
Webster, TX -
Hi all,
I don't know if my question has already been answered in former postings so excuse if it has.
I have a textfile opened as RandomAccessFile for read and write. Now I'm looking for a string in this file by this code:
do{
sText=fFile.readLine();
while (!(sText.equalsIgnoreCase("Information")));
Now I want to extend the String "Information" with "read=1" so the complete string is "Information read=1" and want to write this back in my File. Now I have two problems:
1. How can I replace the old "Information" in my file with my new string?
2. How can I prevent overwriting the following data?
Please help
Thanks in advance
MarkoI also thought copying the whole file into a string but this function is part of an often used class and the file's sitze may vary up to some megabytes with many "information" strings inside so this may cause problems.
Hello,
if this file isn't too big, I would prefer to load the
hole file in a string and simply insert " read=1"
behind the "information" position in that string. When
this is done simply write the hole string back to the
file.
greetings
Marsian -
Putting variable text into dynamic text field
How can I make var text input into a dynamic text field that
appears within another timeline (movieclip) on a different
frame?How can I make var text input into a dynamic text field that
appears within another timeline (movieclip) on a different
frame? -
Dear all,
How i will print the result directly to the html file instead of print output in the console.
Give the sample code.
Thanks & Regards,
kumarHi kumar :)
I'm not sure if this is what you mean but Jakarta has an Element Construction
Set (ECS) API that can generate elements for HTML and XML mark-up
languages.
Please checkout their site: http://jakarta.apache.org/ecs/ -
Import text into a form from a tab delimited file using an action
Good evening.
I am using Adobe Acrobat XI Pro
I have been working all weekend so far on this, and have tried many options.
What I am wanting is to import a line of data from an excel file into a form, save the file with a name drived from the form fields, close the new file, then go back to the original file, import a line of data, and so on and so on.
I had all of this working in livecyle with a tool, but now that we are going to Windows 8 and Microsoft Office 2013, the driver that I need to load the excel file into the form is not available--so now I have to redo the forms in Adobe and import using a tab delimited file.
I would like to do this with an action.
Thus far, I have the following.
**Credit goes to George Johnson who helped me with the script to save the file using field names a few months ago**
To start, I have a folder level script
mySaveAs = app.trustPropagatorFunction(function(doc,path)
app.beginPriv();
var myDoc = event.target;
myDoc.saveAs(path);
app.endPriv();
myTrustedSpecialTaskFunc = app.trustedFunction(function(doc,path)
//privileged and/or non-privileged code above
app.beginPriv();
mySaveAs(doc, path);
app.endPriv
//Privileged and/or non-privileged code below
For the Action, I start with the Form file loaded
Then I execute a javascript to import the text into the file.
this.importTextData("/c/data/clerical.txt");
The next step is to save the file using field names as part of the file name
--credit goes to George Johnson who assisted me with this on a similar project a few months ago.
//Get the Field Value
var fn=getField("Last").valueAsString + "-" + getField("First").valueAsString;
//Specify the folder
var fldr = "/c/data/";
//Determine the full path
var fp=fldr + fn + ".pdf";
//save the file
myTrustedSpecialTaskFunc(this, fp);
That is as far as I have gotten.
What I want to do now is load the original form file, import the next line into the form, save the file, repeat.
If anyone could assist me, I would greatly appreciate it.
**note I had to type this from my I-pad because I kept getting kicked off the internet from my computer. I hope my code is typed correctly.George
Thank you so much for your response.
Yes--there are multiple lines in the data file--it will vary from month to month. It looks like from what you are saying is that I need to do the global variable since it will constantly change, and then increment it as it goes through the text file. When it reaches the end, then it will stop.
I looked at the following links--but this is from Adobe 9 API--I don't know if things have changed with XI--especially since 9 used batch processing and XI has actions.
Count PDF Files
http://help.adobe.com/livedocs/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/ wwhelp.htm?href=JS_API_AcroJS.88.1.html
Global counter
http://help.adobe.com/livedocs/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/ wwhelp.htm?href=JS_API_AcroJS.88.1.html
I am not exactly sure how to include this in my code.
If you could point me in the right direction, I would appreciate it. -
How to put selected videos into one place (File)
How to put selected videos into a File so I can only show on TV the videos in that file
YYou have to describe your issue in more detail. Are you using iTunes? Trying to see it in Apple TV, etc, etc.
-
ODI:data RDBMS and put it into a file
hi i need to put data from an rdbms to flat file using a variable to specify which file to put the data in.
now i know how to put the data into flat file by specifying the file name as the resource name while creating the target datastore.
now i need to use a variable instead of directly specifying the file name.
the variable must contain a query that can fetch the file name based on the count of another variable..........so i can chose which file to write the data too......hi....thanks for the help
i created a variable named var1
i entered abc.txt as the default value of the variable.
in the target datastore resource name i entered #var1
and i created the package with var1 as refreshing followed by my interface as you said.
the problem is that the file being created is with the name #var1 and not abc.txt
when i open this file with notepad it contains the correct data.
can you pls help me with this...... -
This PostScript file was created from an encrypted PDF file.
I have a postscript file which has been created from secure or encrypted (opening restriction) pdf.
Now when i use distiller to convert this postscript file to pdf then distiller cannot produce a pdf file.
The log file contains following text:
This PostScript file was created from an encrypted PDF file.
Redistilling encrypted PDF is not permitted.
%%[ Flushing: rest of job (to end-of-file) will be ignored ]%%
%%[ Warning: PostScript error. No PDF file produced. ] %%
1) Is there a way to convert this postscript file into pdf ?
I have a limitation that i cannot remove security from secure pdf.
2) Do distiller provide any settings which can be changed to convert
this kind of ps(from secure pdf) to pdf.
3) Can we provide password to distiller during process of conversion to
pdf.
4) If above methods do not work then is there a way we can
programatically use Distiller Api's for conversion of postscript (in case
of postscript created from secure pdf) to pdf
Like methods 'FileToPdf' etc.
Thanks in advance.I am facing a similar problem.
My workflow dictates that I convert the input PDF job initially to PS and finally back to PDF. If the input PDF file is secure (it's not encrypted - you will still be able to open the document), the redistillation of PS to PDF fails while using Normalizer 6.0 && 9.0 libraries. If I use Normalizer 505 library, the redistillation succeeds. I have checked with the same generated PS on both Distiller 6.0 && 9.0, and both the versions fail to reconvert as well. I am a little surprised that 6.0 and 9.0 will fail to do something that 505 library manages.
Any suggestions? -
How to write a unicode text in pdf file
Dear Friends,
I am a beginner in acrobat pdf plug-in development. I was trying to write a unicode text (Tamil text) into pdf file.
Using same api I am able to write english text in time-roman, areal etc fonts. But I am not able to write tamil texts.
The code is as below:
memset(&pdeFontAttrs, 0, sizeof(pdeFontAttrs));
pdeFontAttrs.name = ASAtomFromString("Latha");
pdeFontAttrs.type = ASAtomFromString("TrueType");
pdeFont = PDEFontCreateFromSysFont( \
PDFindSysFont(&pdeFontAttrs, sizeof(pdeFontAttrs), 0), \
kPDEFontCreateEmbedded);
pdeText = PDETextCreate();
PDETextAdd(pdeText, kPDETextRun, 0, (ASUInt8 *)buffer, _tcslen(buffer),
pdeFont, &gState, sizeof(gState), NULL, 0, &textMatrix, NULL);
PDEContentAddElem(pdeContent, kPDEAfterLast, (PDEElement)pdeText);
PDPageSetPDEContent(pdPage, gExtensionID);
PDPageReleasePDEContent (pdPage, gExtensionID);
KIndly assume that PDEGraphicsState and PDETextMatrix are set properly set, I am not pasting entire code to avoid complexity.
Thank you,
SafiqDear lrosenth,
I went through some codes/suggestions in internet and I found that I need to have cmap file and cid font file for the respective font since pdf doesn't support unicode fonts directly.
Can you help me to know where can I get cmap file and cid font file for tamil language font Latha(TrueType) microsoft font.
Regards,
Safiq -
How to insert text in existing file.?????
how to insert text in existing file.?????
my file contains simple text with numbers of lines having more then 10 MB size and it might be increase up to 100MB.
i required to seek to spec. position and insert chunk of characters to file without overwriting existing one.
I tried out with RandomAccessFile class Also.
Pl. Suggest me way to insert String in existing file.
Thanks ,
Timirhow to insert text in existing file.?????You can't "insert" text into an existing file. You can
overwrite portions of an existing file or extend one by
writing past the current end of file.
If you want to insert text into a file you have to write
out a new file. -
How to enable commenting into pdf files using java?
Hi All,
Is there any way available to enable comments into pdf files through java. I have a Adobe Reader 9 and also I want put some comments into pdf file, but the reader is not allowed to place a comment into pdf file before enabling the Comments into pdf. After enabling the comments in pdf file then only we can place the comments and we can the pdf file with comments.
Is there any way available to enable comments into pdf file to view acrobat reader.
Thanks in advance.The end user who uses the web application has Acrobat installed in their mahcine needs it only for the purpose of enabling comments in pdf. If this task of enabling comments in pdf is done through my application there is no need for acrobat in such user's machine which was requested as a cost cuttnig measure.
For this purpose, i need to know about how to enable comments in pdf through java api.
I have used itext java api for other pdf related manipulation in java. But it does not have feature as per the requirement posted above. Can any body suggest relevant java api to achieve the task requested?
Tahnks in Advance.
Maybe you are looking for
-
ERROR WHEN OPENING BB WORLD OR LOADING ANY NEW APP
I get this message all the time >>> Sorry, your session has expired. Please close all of your browser windows and then return to the welcome page to start again. Copyright ©2011 Research In Motion Limited, unless otherwise noted. Marius Entco - The E
-
After a recent crash with my DinoPowerBook I had to reinstall CS2
And of course, CS2 is no longer supported. I downloaded this version: Download Acrobat 7 and CS2 products Which says Acrobat is present; however, its not in the CS2 Installer list (see below) How do I install Acrobat 7 (Professional for Mac) form thi
-
Limitation? Printing Address Book "Note"
Neither I nor the One-to-One people at the SF Apple Store could figure out how to print an AB note that is more than one page in length. Is that a limitation? I have many notes longer than a page that I occasionally print.
-
HT2330 How to transfer itunes on my dual G4 OS 10.4.11 to new iPad.
I want to transfer my itunes on my dual G4 OS 10.4.11 to my new iPad any suggestions please. iTunes is old version without "devices" listing on left column. Thanks very much.
-
Why won't photoshop elements download for me
why won't photoshop elements download for me