Count of characters

Dear experts,
Can I do a count of characters in an Acrobat document?
Yours Knud Lindholm Lau, Copenhagen

Yes, but you will need to write a program for that in Acrobat JavaScript to do that task. If you plan on doing this on a regular basis you might want to use JavaScript to add a menu item or tool bar button to run the script.

Similar Messages

  • Count of characters clipped or corrupted in conventional composition

    In conventional Modern English composition there is more drawing from character codes whereas in classic Early Modern English composition there is more drawing from default glyph codes.
    If Apple Advanced Typography or Microsoft OpenType is used in Apple Pages then between 10% and 40% of the source character string is clipped.
    If Apple Advanced Typography or Microsoft OpenType is used in Apple TextEdit 1.4 for Mac OS X 10.4 and Apple TextEdit 1.5 for Mac OS X 10.5, then some 4% of the source character string is clipped.
    These counts do not include substitution of correct public characters for incorrect private charactoids and incorrect public characters.
    Because more of the drawing must be done in glyph space for Arabic and Indic than for Latin, Greek, Cyrillic and Chinese-Japanese-Korean, one would assume that the scale of the clipping is lowest for the simple scripts and highest for the complex scripts. If someone wants to spend a couple of days counting clipping for Arabic and Indic, it might be worthwhile to know the figures.
    /hh

    Could you explain what you mean by "clipping" and give an example of how you have gone about measuring it?
    Modern imaging models distinguish between content information and imageable appearance, or in technical shorthand terms between code space and data space where the transform between code space and data space is evaluatable (: there are alternate stylistic appearances available as rendering intents in the transform) and where data space is almost any data model (: e.g. prescaled bitmap, TrueType splines, Type 1 splines, indeed any spline programming language for which the system has a scaler / similar data space format flexibility in ICC imaging).
    If content information is mapped to imageable appearance, and if imageable appearance is mapped back to content information, clipping of content information can occur either in the first or in the second step of the transform. In the current context, clipping occurs because PDF does not preserve the source character string complete. The amount of clipping depends on the genre of the copy (annual report or history thesis with heavy use of tabular lower case numbers, proportional lower case numbers, superiors numbers, inferior numbers, small upper case, and lower case ligatures) and on how much of the GLYF Glyph table is drawn off the CMAP Character Map versus how much is drawn off the MORX Metamorphosis Extended or GSUB Glyph Substitution tables which is where clipping occurs since there may be no cross-font glyph identifiers for a PDF consumer to synthesise the source character string from.
    Currently, the system supposedly uses cross-font glyph identifiers for CFF-housed SFNT and the CMAP for TTF-housed SFNT. Driver-level Unicode imaging works like driver-level ICC imaging, which has been much discussed. Basically, in driver-level Unicode imaging the tags of the tagged SFNT file format are stripped and the CFF font program dictionary (a font within a font) is decompressed into Type 1 and streamed into the PostScript language page description program which leaves only the PostScript name space (PostScript is deliberaty designed not to use a coded character set). If the data space is not CFF but TTF, then either the splines are converted to Type 1 (up to and including OS X 10.3) or a Type42 font is generated where it is legal among other things to strip the POST PostScript glyph name table.
    With regard to the calculation method, it is basic. Download and install the Word Counter widget from SuperMagnus Software, available through the Download section of Apple's web site (for whatever reason the Word Counter applet does not appear as reliable). Set the Word Counter widget to exclude word spaces since PDF is winging word spaces anyway (they are synthesised). Input a source character string and count the characters it contains. Compose the source character string with Use Ligatures enabled (whether in Pages or Word 2008 or in TextEdit), use the Typography Palette (not for Word, though) for additional local and manual line layout that cannot be accomplished globally and automatically, save to PDF 1.3, attempt to recover the source character string using e.g. Apple Preview, copy into TextEdit to strip the formatting, copy the character string stripped of formatting into the Word Counter widget, calculate the difference, divide the source number with the difference, multiply by 100, and you have the percentage of clipped characters not counting incorrect public characters and incorrect private charactoids added by the PDF decomposition.
    For example, for a passage from Shlomo Perets' discussion of defect decomposition in the Adobe OpenType Guide published in 2002 see http://www.planetpdf.com/enterprise/article.asp?ContentID=6521 and the following count :
    3. HTML Composition in CMAP Character Map Table of Microsoft Georgia
    copy 12pt on 14pt
    To see potential problems with products that support advanced typography features, such as ligatures, small caps and old-style numerals, see the Adobe OpenType User Guide, authored with Adobe InDesign and exported directly to PDF. "2002" is present in the first page below the title—but cannot be located as since old-style figures are used. The SFNT acronym present in the first paragraph in page 2 cannot be located, as it uses small-caps. "Microsoft" is present 5 times in this document—but none of the instances can be located due to the use of ligatures (ft in this case). Even the word "This" in the opening paragraph in page 2 (line before last) cannot be located due to the use of ligatures. The more common fi, fl, ffi ligatures are searchable in the case of this document, but this is not the case in other documents using these ligatures (this depends on the applications used to author/create the PDF). While these OpenType features result in a superior typography, they should be avoided in online documents, until Acrobat Find and Search functions are enhanced to support the additional characters.
    Shlomo Perets, PDF Best Practices 5: Acrobat Find & Search, PlanetPDF: 22 April 2002
    type product
    Adobe Minion Pro, neither ligatures, nor small capitals, nor lower case numbers ('Old Style Figures') are searchable.
    typesetting logic
    Microsoft OpenType logic (12pt Common Ligatures, Small Capitals, Small Capitals From Capitals, Old Style Figures).
    type version
    Type version 2.012; PS 002.000; core 1.0.38; makeotf.lib1.6.6565. System version Apple Mac OS X 10.4.11. Application version Apple Pages 4.0.
    [Count of 1374 correct public characters.]
    3.1. Composition in CMAP Character Map Table and GSUB Glyph Substitution Table of Adobe Minion Pro 2, Apple Pages 4.0, and Apple Mac OS X 10.4.11
    Please see parallel PDF.
    3.2. Copied PDF Decomposition Composed in CMAP Character Map Table of Microsoft Georgia : Clipped 9.8% off Source Character String
    To see potential problems with products that support advanced typography features, such
    as ligatures, small caps and old-style numerals, see the Adobe OpenType User Guide,
    authored with Adobe InDesign and exported directly to . "" is present in the rst
    page below the title—but cannot be located as since old-style gures are used. e
    acronym present in the rst paragraph in page cannot be located, as it uses small-caps.
    "Microso" is present times in this document—but none of the instances can be located
    due to the use of ligatures ( in this case). Even the word "is" in the opening paragraph in
    page (line before last) cannot be located due to the use of ligatures. e more common ,
    , ligatures are searchable in the case of this document, but this is not the case in other
    documents using these ligatures (this depends on the applications used to author/create the
    ). While these OpenType features result in a superior typography, they should be avoided
    in online documents, until Acrobat Find and Search functions are enhanced to support the
    additional characters.
    Shlomo Perets, Best Practices : Acrobat Find & Search, PlanetPDF: April
    Adobe Minion Pro, neither ligatures, nor small capitals, nor lower case numbers ('Old Style
    Figures') are searchable.
    Microso OpenType logic (pt Common Ligatures, Small Capitals, Small Capitals From
    Capitals, Old Style Figures).
    Type version .; .; core ..; makeotf.lib... System version Apple Mac
    OS X ... Application version Apple Pages ..
    [Count of 1239 characters, including incorrect public characters and incorrect private charactoids.]

  • Count of characters in a string

    Hi all,
    Is there any way to find the repeating characters in the string like 'L' in the example Hello ..
    Thanks in advance,
    Nalla !
    Message was edited by: Nalla
    Nalla (Nallasivam)

    test@ORA10G>
    test@ORA10G> with t as (
      2    select 'hello' as str from dual union all
      3    select 'abracadabra' from dual union all
      4    select 'the quick brown fox jumps over the lazy dog' from dual union all
      5    select 'abcdefghijklmnopqrstuvwxyz' from dual union all
      6    select 'facetious' from dual)
      7  --
      8  select
      9    str
    10  from t
    11  where (
    12    length(str) - length(replace(lower(str),'a')) > 1 or
    13    length(str) - length(replace(lower(str),'b')) > 1 or
    14    length(str) - length(replace(lower(str),'c')) > 1 or
    15    length(str) - length(replace(lower(str),'d')) > 1 or
    16    length(str) - length(replace(lower(str),'e')) > 1 or
    17    length(str) - length(replace(lower(str),'f')) > 1 or
    18    length(str) - length(replace(lower(str),'g')) > 1 or
    19    length(str) - length(replace(lower(str),'h')) > 1 or
    20    length(str) - length(replace(lower(str),'i')) > 1 or
    21    length(str) - length(replace(lower(str),'j')) > 1 or
    22    length(str) - length(replace(lower(str),'k')) > 1 or
    23    length(str) - length(replace(lower(str),'l')) > 1 or
    24    length(str) - length(replace(lower(str),'m')) > 1 or
    25    length(str) - length(replace(lower(str),'n')) > 1 or
    26    length(str) - length(replace(lower(str),'o')) > 1 or
    27    length(str) - length(replace(lower(str),'p')) > 1 or
    28    length(str) - length(replace(lower(str),'q')) > 1 or
    29    length(str) - length(replace(lower(str),'r')) > 1 or
    30    length(str) - length(replace(lower(str),'s')) > 1 or
    31    length(str) - length(replace(lower(str),'t')) > 1 or
    32    length(str) - length(replace(lower(str),'u')) > 1 or
    33    length(str) - length(replace(lower(str),'v')) > 1 or
    34    length(str) - length(replace(lower(str),'w')) > 1 or
    35    length(str) - length(replace(lower(str),'x')) > 1 or
    36    length(str) - length(replace(lower(str),'y')) > 1 or
    37    length(str) - length(replace(lower(str),'z')) > 1
    38  );
    STR
    hello
    abracadabra
    the quick brown fox jumps over the lazy dog
    3 rows selected.
    test@ORA10G>
    test@ORA10G>pratz

  • Counting specific characters in string

    // method  that counts and returns the number of times a specific character
    // appears in the data string
    public int numChar(char _charData)
         for(int i = 0; i < dataString.length(); i++)
               if(_charData == dataString.indexOf(_charData))
                    int count = 1;
                    int countIt = 0;
                    countIt = countIt + count;
                    return countIt;
    int nothing = 0;
    return nothing;
    }

    And your question is....?
    I have one: Where does dataString come from? You don't pass it in. Seems ridiculous to make it a class member.
    This is wrong:
    if(_charData == dataString.indexOf(_charData))Should be:
    if(_charData == dataString.charAt(i))The logic inside the if is incorrect, too. You don't want to return after the first time you find a character. You want to loop all the way through and count all the instances.
    You might have been trying to stop the loop once the indexOf returned -1, but you should be doing it on the remaining substring in that case.
    The style is poor. If I were reviewing your code, I'd say that your "nothing = 0" doesn't add any value.
    I'd write it like this:
    public class CharCounter
       public static void main(String [] args)
          if (args.length > 1)
             String str  = args[0];
             char ch     = args[1].charAt(0);
             System.out.println("str  : " + str);
             System.out.println("ch   : " + ch);
             System.out.println("count: " + getCharCount(ch, str));
       public static int getCharCount(char ch, String str)  
          int charCount = 0;
          if (str != null)
             int numChars = str.length();
             for (int i = 0; i < numChars; ++i)
                if (ch == str.charAt(i))
                   ++charCount;
          return charCount; 
    }%

  • How to count number of characters in a string?

    Hi
    I need to display values in a script. but the alignment getting distrubed if it is less than 20 charaters, for exmple material descirption is only displaying 20 characters in script. if it is less than 20 charcters the alignment getting changed.
    please help me ...urgent..
    thanks in advance...

    solution to this problem in script is not to count the characters but to align them based on positions .
    1.
    Use the tab positions  for that paragraph format to display the values in a finite format .
    In this u need to give the position start and position end length and use the same in the script as
    p ,,&itab-f1&
    say my value has to print from position 125mm to 155 mm
    i take one tab position for this paragraph format P and maintain the same in the output.
    here ,, is the tab position .
    See whether it is one character or 20 character it has to behave the same way it should not be misaligned .
    check the tab position for that paragraph format in Tabs ..
    regards,
    vijay.

  • Counting Characters in a string

    HI all!
    I am new working with java and i have an application where I have to count specific characters in a string e.g. 'a','.','H','4' and so on! I found an entry in the forum with this script:
    String text = "Hello World!";
    int count = 0;
    for (int x = 0; x < text.length(); x++)
    if (text.charAt(x) == 'l')
    count++;
    This Script count all the 'I', but I could not get CharAt to count different characters at once!
    Is there a way?
    Thx for your help!
    LeBite

    String text = "Hello World!";
    int countl = 0;
    int counto = 0;
    for (int x = 0; x < text.length(); x++)
        if (text.charAt(x) == 'l') countl++;
        if (text.charAt(x) == 'o') counto++;
    [/code[                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Count number of Characters in CLOB field

    Hi all,
    I posted this on another database, but I think it really belongs here. I have a CLOB field that stores reports in HTML markup languate. Here's an example of a report.
    <br><br></title> </head> <body contenteditable="true" text="#000000" bgcolor="#ffffff"> this is a test for a bilateral modifier </body> </html><br><br>
    I'm trying to provide a query that counts the number of characters that is not a HTML tag nor whitespace. I've attempted to use a combination of the length and replace function which first replace all HTML tags and whitespaces with nothing and then uses length to calculate the number of characters. Here's what the function looks like.
    <br><br>length(trim (both ' ' from replace (replace (replace(replace (replace(replace(replace(replace (replace(replace(replace (replace(replace (replace(reports.report_text ,'</head>',''),'</title>',''),'<body contenteditable="true" text="#000000" bgcolor="#ffffff">',''),'</body>',''),'</html>',''),'',''),'',''),'',''),'',''),'',''),'',''),'',''),'',''),'>','')))
    <br><br>
    For the example above, the number of characters counted in the outputs is 66, which is clearly incorrect. I need to only count these characters for the example above "thisisatestforabilateralmodifier", but there is still white space that remains after I do the sequence of replaces. If someone can help, it's be greatly appreciated. Thanks.
    Message was edited by:
    user577468

    If you can convert your html string to valid xml you can do the following:
    michaels>  SELECT str, LENGTH(REPLACE(REPLACE(XMLTYPE (str).EXTRACT ('//text()').getclobval(),CHR(10)),' ')) length
      FROM (SELECT
    '<html>
    <head>
      <title></title>
    </head>
    <body contenteditable="true" text="#000000" bgcolor="#ffffff">
       this is a test for a bilateral modifier
    </body>
    </html>' str FROM DUAL)
    STR                                                                        LENGTH
    <html>                                                                         32
    <head>                                                                         
      <title></title>                                                               
    </head>                                                                        
    <body contenteditable="true" text="#000000" bgcolor="#ffffff">                 
       this is a test for a bilateral modifier                                      
    </body>                                                                        
    </html>                                                                          Otherwise regex_replace would be an alternative (on 10g).

  • Dynamic character count

    Is it possible to have a display of how many characters are showing in a text box (without highlighting text) and when the size of the box is changed the character count is updated.
    For example if I have a text box and I have more text in that box then can fit so it is "busting out of the box"... can I get a character count display telling me how many characters are in the text box disregarding the overflow text... and as I pick up the text box handles and start resizing the text box the character count display updates on the fly... only counting the characters visible in the text box and not the ones that have busted out of the box.
    Regards, Tim

    There appears to be something wrong with your InDesign. This is what it looks like for me:
    Try resettting your preferences.

  • Character counting (count down) in Acrobat

    I have a PDF file with text fields that is going to be used by some of our writers and integrated into presentation decks across multiple programs. We have a lot of it working well and I've been able to piece some bits of code together here and there but I'm no programmer. Where I've hit a roadblock is with adding a visual character counter to the file.
    The file is set up to reflect an actual printed piece where there are limitations on line counts and characters per line. The line counts we aren't as concerned with but having a counter display how many characters you've typed to a line is important. I hope this makes sense. So basically we have one area where you can have a total of 10 lines and 30 characters (including spaces) on each line for a total of 300 characters. What would be great for us is if the text field could have a counter pop up showing something stating that the writer has entered "10 out of 30" characters for the particular line they're on.
    Is this a simple fix or something where I could be pointed somewhere to put a script togeteher? I've tried for a few days now and frankly this is like launching a missle into space for me. I'd greatly appreciate any help/insight you could offer and would be glad to share my expertise on any design or experience issues you may be having.

    Those are all great ideas Max and certainly stuff we can consider for building on this.
    The reason we need to block the characters after a certain count is due to a system this will be entered into. Our client will be copying and pasting the blocks of text into a technology platform that will then print the info. We were given a specific set of instructions for how many characters and lines the printed piece could hold.
    The fun part is that before this goes into production it has to first be presented several times in different presentation decks (some integrated into Powerpoint, others just PDFs). We've tried similar exercises in the past with Word and other programs with not a lot of satisfaction from our client. So, no pun intended, but Acrobat offered the most portable file format to accomplish our needs.
    Though the original code posted above doesn't exactly solve our problem it's a great start for us and gives us somethign to build off of.
    This is a simple one I think. What's the command to add text to a field? So if I wanted to add the character "\n" once the text was full. I guess that would be something like (just a note, not real code)…
    var hardreturn = \n;
    if (max == 25) {
    addText.value = hardreturn;
    (sorry a million times for my horrible programming skills)
    Thanks for everyone's input thus far. This is a great and informative discussion.
    Message was edited by: b.whitham

  • Where, if any, Word Count and Word Frequency tools on Apple Works or MS Wrd

    5/26/2008. Is there a "word count" and/or "word frequency" tool(s) on Apple Works word document and/or Microsoft Word for Mac word document, and how does one use or activate it, or find such for it on the web?? Many thanks. C. Yopst, Chicago

    Hi C,
    In an AppleWorks WP document, go Edit > Writing Tools > Word count. This will give you a count of characters, words, lines and paragraphs in the document or, if you have selected a portion of the document, in the selection.
    To my knowledge, there's no tool to give a word frequency figure, although that could be done with some fairly easy manipulation involving a spreadsheet.
    For MS Word questions, I'd suggest checking the Word section of Microsoft's Mactopia site. Try searching "count words".
    Regards,
    Barry

  • Text/Character Counter

    It quite annoys me that the iPhone doesn't have this very simple feature.
    Because you can type 'normally' with a full keypad available, I find it very easy to write long text messages that may span 2 or 3 texts, which was not the case when I had a non-smartphone before (a stupidphone, I guess).
    I think Apple should introduce a simple, standard feature which counts the characters you have left and then when you use too many for 1 text message, it lets you know.... so just a counter in the corner which may go, 158/1, 159/1, 160/1 and then 1/2, 2/2, 3/2 etc... just so you can tell and shorten the text if you've only just spilled over to text #2.
    This would save me a lot of money over the contract I think... I've probably sent texts that are only a few characters into new text countless times.
    Thoughts?

    Where did I say you would type four rows of uppercase W's? Of course you wouldn't.
    I was simply trying to illustrate that some letters take up much more space than others. Therefore you are still guessing if you use the four line rule.
    Use it if you like but you may still end up with a text that is split into two messages.
    I wasn't arguing. Just pointing out that it's not as clear cut as four lines of text is the limit and explaining the reasons why.

  • Saving characters with ASCII codes (128 - 256) into txt file problem

    Hello,
    I am saving a query results into a text file (test.txt) with this procedure:
    BEGIN
    OWA_UTIL.mime_header ('application/octet', FALSE);
    HTP.p ('Content-Disposition: attachment; filename="TEST.TXT"');
    OWA_UTIL.http_header_close;
    for rec in (select sample_text from tmp)
    loop
    htp.prn ( chr(230) || rec.sample_text || utl_tcp.crlf);
    end loop;
    -- Send an error code so that the rest of the HTML does not render
    HTMLDB_APPLICATION.g_unrecoverable_error := TRUE;
    END;
    How can I save characters with ascii codes from 128 - 256 into the output file? If I use chr() function, characters are missing in the output file.
    Platform: Apex 4.2 on apex.oracle.com

    Hi 1010398,
    Some thoughts:
    I assume you've counted the characters in the output and/or used a "hex" text editor so you KNOW these characters are not being written. Are they not written at all, or are blanks being substituted or are NULLs being substituted?
    I couldn't find much documentation on htp.prn. Though, one place I found
    htp.prn (cbuf IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL);Do you suppose it's affected by the character set used?
    Howard

  • Preview search doesn't work for all ASCII characters

    The title pretty much says it all. The behavior is completely broken. Any searches for words that contain a non-letter, non-number ASCII, non-standard punctuation character, e.g., @#$%^&*()+, kind of ignores the special characters. For example:
    Find: C++
    Finds all pages with the text "C++", but doesn't highlight that text. Instead, it highlights all "C" and "c" characters, and the find counts for those pages are the number of C characters. Note that it neither highlights nor counts C characters on pages that don't contain "C++"
    Find: "C++"
    Finds about half the pages and the find count is correct, but it highlights only C characters that are followed by ++ OR other special characters, e.g. it highlights the C in "C#".

    mentalwasteland wrote:
    I simply want it to work as the documentation says it works.
    By all means tell Apple it does not perform according to their documentation when you ask them to fix it.
    Does Adobe Reader do any better?  I don't know if it might have its own search system....

  • Wrong character count in SMS

    When I compose a new SMS, the character count is wrong, because special characters take more space than normal ones.
    As an example, if a regular SMS takes 160 characters, if I use special characters such as á, é, €… the same SMS will take more characters and therefore they will bill me for 2 SMS, or more instead of one.
    Sorry for my poor English but it is not my mother tongue

    I see this is by design, but there is a difference in the bill, if I send 30 or 60 SMS because I send special characters. I know the quick solution is to avoid sending this characters, but the application should be smart enough to count the characters I'm being billed as this is all the purpose of character counting in my humble opinion.
    So, iPhone is doing it right counting 7-bit characters, but not OK counting the "real characters I'm paying for" which is more important to me. I guess no one cares about how many characters takes to say something just for the quantity's sake unless they are using Twitter I hope my explanation was quite clear!
    This should be a bug, not a feature, in my very humble opinion

  • Need to count character from an xml

    Hi all,
    I need to count character from a field. and store it in a variable. My datasource is from xml file.
    Any ideas for the syntax?
    thanks in advance,
    Paolyn

    Use <?string-length(FIELD)?> to get the count of characters.

Maybe you are looking for

  • What is the best way to make a HDMI connection?

    I have a 13" Macbook Pro, bought in late 2011, therefore I have the Thunderbolt port. I do not think it has a mini DVI port. Therefore my question is what is the best way to connect this great Mac to a HDTV using an HDMI port on the TV?

  • Need help restoring data

    I have several disparate Windows 2003-based database with limited storage and memory resources. Each database is running in NOARCHIVE mode. I have a need to backup the database prior to upgrades. If errors occur, I'd like to be able to restore the da

  • How do I create a similar website (Was: how to make)

    i need link for tutorial or little help i try make it site somthing like this { link removed by moderator } but i dont know how to start any ideas ?

  • Multiple Image Storage

    Hi all, I need to store multiple images into the database. I am using stored procedure for the same. I am passing image as byte[] and since i have to store multiple images at one go, I am just switching between my Java code and the database procedure

  • How do I access an app in the cloud

    How do you access an app through iCloud?