Acrobat replaces single-byte character codes with octal strings in content stream, how to prevent?

I have thousands of PDFs, mainly text, all fonts are subsets, indexes starting from 1. In page content stream I see character indexes represented as single bytes: binary 1, 2, 3, etc. But, after optimizing files with Acrobat (I use it to save to 1.6 version with compressed object streams etc.) those single bytes become octal strings like \001, \002, ... . Raw stream size is increased by factor 1.5, and after a flate filter there is still 1-2 kB increase for each page. As there are thousands of pages, total (and totally useless) increase is considerable and doesn't go well with my goal of creating as small package as possible.
Can this behavior be prevented (with something like registry setting)?

what are you calling getBytes() on?he's calling getBytes() on his String object.
@ puneet_k,
I don't have a solution but note that on Unix-like systems a newline is a single byte 0x0a and on DOS-like systems (Windows) it is a sequence of bytes 0x0d and 0x0a.
Some text editors handle both.
I'm not sure but I think on Unix,
new String("\n").getBytes() equals new byte[] { 0x0a }
and on DOS
new String("\n").getBytes() equals new byte[] { 0x0d, 0x0a }

Similar Messages

  • Unable to generate single byte character when used TO_SINGLE_BYTE

    Hi All,
    Can anyone help me in getting the output for the below single byte query. When tried it says INVALID NUMBER.
    Step 1 :-
    select RAWTOHEX('2Z') from DUAL; -- 325A
    Step 2:-
    SELECT TO_SINGLE_BYTE(CHR('325A')) FROM DUAL;
    The above query when executed it says "ORA-01722: invalid number".
    I tried using VARCHAR2 instead of CHR it throuws the below exception,
    "ORA-00936: missing expression".
    But the same query if no characters are passed is working fine.
    SELECT TO_SINGLE_BYTE(CHR('3251')) FROM DUAL;
    Thanks,
    Ravi

    TO_SINGLE_BYTE is used to convert multi-byte characters to single-byte characters. '325A' is not a multi-byte character so can't be converted.
    Use HEXTORAW to convert the hex value back to a raw value.

  • Function to replace/delete specific character(s) in a string

    Hi, experienced CVI guys,
    Are there some functions shipped with CVI to replace or delete specific characters in a string?
    For example, I want to replace all \/|- with an empty string, or to delete them. What can I do?  Loops are too complex.
    Original string:
    Erasing Device...
    \|/- \ \ \\|/-\|/ \
    Report
    07-Sep-2010, 08:04:55
    Result I want is
    Erasing Device...
    Report
    07-Sep-2010, 08:04:55
    Thanks.
    Solved!
    Go to Solution.

    labc:
    How generic do you want to make your filter?
    For our discussion, I'll call your series of characters a text spinner.  I'm assuming the number of characters in it may vary, but that the pattern is consistent in the respect: the spinner is made up of characters like \ / | -, each followed by the ASCII backspace (char) 8.  (That's 8 cast as a character, which is not the same as '8'.)  In your sample spinner pattern, every occurrence of the ASCII backspace is preceded by one of the spinner characters.  Let's assume that this pattern is constant.
    So what I'd do is search through your input string (yes, using a loop) and copy the input string byte by byte to an output string.  If you find an ASCII backspace in the input string, skip it, and overwrite the last character in the output string (which is one of the spinner characters) with the next character in the input string.
    Yes, you are using a loop, but it's not too complex.
    Here's the whole loop, written as a function.
    // filterSpinner function to strip the text spinner characters out of a string.
    // The text spinner is made up of \ / | - characters separated by (char) 8 (ASCII backspace)
    int filterSpinner(char *inputString, char *outputString)
     int inputPtr, outputPtr = 0;
     // walk though the input string
     for (inputPtr = 0; inputPtr < strlen(inputString); inputPtr++, outputPtr++)
      // search for the ASCII backspace character that's part of the spinner
      if (inputString[inputPtr] == 8)
       // if the ASCII backspace is found,
       inputPtr++;  // increment the inputString pointer to skip the backspace
       outputPtr--; // decrement the outputString pointer to overwrite
           // the spinner character that preceded the backspace
      outputString[outputPtr] = inputString[inputPtr];
     outputString[outputPtr] = '\0';
     return 0;
    You'll also find an attached CVI program which uses it on your sample string.
    Attachments:
    FilterSpinner1.zip ‏5 KB

  • Replacing sap isu tax code with sap r/3 while transferring documents

    we are using different tax code in SAP ISU then the one used in SAP CORPORATE..is there any way we can replace the tax code used in SAP ISU with the one used SAP R 3 while transferring the documents through ALE
    we have used sabstituation rules to populate the GL text and profit centre? can we explore this config to update the tax code?
    Substitution in Accounting Documents     Financial Accounting (New) > Accounts Receivable & Payable > Business Transactions > Incoming Invoices/Credit Memos > Make and Check Document Settings > Substitution in Accounting Documents
    Highly appreciate your help
    vinod

    Vinod:
    Without knowing how to process your requirements - generally speaking substitution is not supported within FICA.  that results in differences between the subledger and ledger - which then are not processable.  Your GL reconciliation will likely have issues, and support will be limited at best. 
    Any substitution-type logic should be done correctly in the subledger prior to transfer.
    regards,
    bill.

  • Urgent: comparing multi-byte characters to a single byte character!

    Let's say I have two strings, they have the same contents but use different encoding, how do I compare them?
    String a = "GOLD";
    String b = "G O L D ";
    The method a.equals(b) doesn't seem to work.

    try this:
    String a = "GOLD";
    String b = "G O L D ";
    boolean bEqual = true;
    int iLength = a.length();
    int j = 0;
    for (int i = 0; i < iLength; i++)  {
       while(b.substring(j,1).equals(" "))
          j++;
       if(!a.substring(i, 1).equals(b.substring(j,1))  {
          bEqual = false;
          break;
    }

  • Replacing New Line character in a hexadecimal string in ECC5.0

    Hi,
    I am trying to create an XML document using ABAP.
    I have created one DOM and later used the DOM to get the XML content into an internal table in form of Hexadecimal String. In that internal table(which contains XML in form of hexadecimal content), I want to search for the new line character and replace it by Space.
    I have used class CL_XML_DOCUMENT to create such document.
    Now, the keyword 'SEARCH' which searches the New Line character, works on the hexadecimal content of the internal table in 46C and I get an XML document. I get the position of the New Line in SY-FDPOS and can do whatever I want. But SEARCH on hexadecimal content is not permitted in ECC 5.0. I get a syntax error when I try to do so. Tried many options but could not succed.
    Would apreciate if anyone can help in finding and replacing characters like new line, tab etc in a hexadecimal string.
    Thanks.
    Can anyone

    Hi!
    When you say hexadecimal string, you mean variable - otherwise string (= character) operations would work?
    Then you have to go for hex handling -> do it yourself. Make something like
    data: lf type x value '0A',
          sp type x value '20',
          i type i.
    I = 0.
    while sy-subrc = 0.
      if hex_string+i(1) = lf.
        hex_string+i(1) = sp.
      endif.
      add 1 to i.
    endwhile.
    Regards,
    Christian

  • Error Code with Livecycle forms, when opened online - how do I fix this?

    Could you please tell me how to fix issue where when I make my forms available online, they open up with an error code?  I provide a link to a file, and when the user opens the file, it says there was an error - about a paragraph of text.  If they save the file, and then open again in Adobe Reader, it works fine.  But most of the time they think the file is corrupt, and don't want to download and save it to their computer.  Below is a screenshot of the problem, and it only happens when I open the file online.  And, I have already upgraded to the most recent version of Adobe, so why does this happen?

    Oh, I found a great instruction page at Configure browser to use the Adobe PDF plug-in  That worked!  Thank you!

  • I am wondering why I cannot empty my trash. I keep getting an error code with 8003. Does anyone know how to solve this problem?

    Hi, I just want to know how to empty my trash because I keep getting this message saying " The operation can't be completed
    because an unexpected error occured (error code-8003) I tried looking this up and couldn't find any refference regarding it.
    Please help

    Please look to the right of the screen where it says "More Like this" you may find the resolution there.

  • Problem with Character Codes...

    For some reason this just isn't working right. It works for
    some characters, like "d" is character code 100, it works for 100
    but if i put in 104, which is "h" it doesnt work! doesnt work 32
    which is space or 33 which is !
    here is my function...
    public function illegalCharCheck(charCheck:String):void{
    var i:int;
    var len:int = charCheck.length;
    for (i = 0; i < len; i++){
    if (charCheck.charCodeAt(i) == 100){
    Alert.show('Illegal Character!', 'Sign Up',
    mx.controls.Alert.OK);
    Ive tried putting the character being checked for in
    different spots in the string(which shouldnt matter).
    So far it has not worked with anything other than 100, but
    i've only tried like 10 or so. It should work for all of them!
    Does anyone have any idea what is going on here?
    Also.. Can i separate the character codes with commas so that
    i can check them all in one if statement (there are a lot), or do i
    need different if statements for each.. or use a switch statement.
    That part isn't really clear to me for some reason...
    Thanks.

    got it... i had the string being imported from
    newUserNameInput.toString(); instead of newUserNameInput.text
    private var illegalChars:Array = new Array(32, 33, 34, 35,
    36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62,
    63, 64, 91, 92, 93, 94, 95, 96, 123, 124, 125, 126)
    public function illegalCharCheck(charCheck:String):void{
    var i:int;
    var i2:int;
    var len:int = charCheck.length;
    var illegalTally:int = 0;
    var illegalLen:int = illegalChars.length;
    debug1.text='';
    for (i = 0; i < len; i++){
    for (i2 = 0; i2 < illegalLen; i2++){
    if (charCheck.charCodeAt(i) == illegalChars[i2]){
    debug1.text=debug1.text+charCheck.charCodeAt(i)+' ';
    illegalTally++;
    if (illegalTally>0){
    debug1.text=debug1.text+' tally='+illegalTally;
    Alert.show('Illegal Character! ', 'Sign Up',
    mx.controls.Alert.OK);
    works like a charm.

  • Oracle Multi-Bytes vs Single-Byte

    Hi,
    We have to add japanese to our application, i had succesfully add japanese data in our single-byte database,
    so why should we use a Multi-byte DB?
    what is the gain to use a Multi byte DB vs a Single Byte?
    does intermedia work with japanese in Single Bytes?
    Is utf8 the best way to have an international DB?
    We will have to add a lot of other char-set in the future.
    Thanks

    so why should we use a Multi-byte DB?
    what is the gain to use a Multi byte DB vs a Single Byte? What you are doing is storing invalid multibyte characters into a single byte database. So each double byte Japanese characters are being treated as 2 separate single byte characters. You are using an unsupported but common garbage in garbage out approach, so in that sense you are using Oracle as a garbage container. :)
    Let's look at some of the issues that you are going to have :-
    All SQL Functions are based on the property of the single byte database character set WE8ISO8859P1. So LENGTH(), SUBSTR (), INSTR (), UPPER(), NLS_UPPER etc .. will yield incorrect results . For example a column with one Japanese character and one ASCII character will return a length of 3 characters rather than 2 characters. And if you want to locate a specific character in a mix ASCII and Japanese string using the SUBSTR() it will be very difficult, because to Oracle the string consists of all single byte characters, it will not skip 2 bytes for a Japanese character. Even if you don't have mix strings, you will need to write one routine for handling ASCII only and another for Japanese strings.
    Invalid Data conversion , if your need to talk to another db using dblink say ,all the character conversion will be based on the single byte character set to the target database character set mapping, so the receiver will lose all the source Japanses characters and will get 2 single byte characters for each Japanese char instead .
    Export and Import will have identical problems, character set conversion are performed during these operations, so all Japanese characters will be lost. This also means that you can not load correctly encoded Japanese data into your current single byte DB using IMPORT or SQLLOADER without data corruption ...
    does intermedia work with japanese in Single Bytes?No
    Is utf8 the best way to have an international DB?Yes
    null

  • How do I globally replace a bold character override in FM10?

    How do I globally replace a bold character override with a specific character format from the character format catalog in FM10? I am not concerned about filtering for specific paragraph tags.
    Thanks,
    Marc

    This is far as I've managed …
    apply the character style in question to a word, then use Edit > Copy special to put the character style in the clipboard
    use Find/change to locate Character format override
    if this finds a local override you want to clean up, click [Change & find]
    Not global in the sense "sort out my whole book with one click", but perhaps a step in the right direction.
    Off-thread question: what's the general feeling about formatting for step 3 – is it OK to be informal and start an instruction with "if"? I like to explain the condition before giving the instruction, to avoid tripping up people like me who tend to process strictly from left to right :-} An indented paragraph after step 2 "If … then continue to step 3" would be thorough, but seems a bit clumsy.

  • Can you define "single quote" character as a constant

    Hello all,
    I want to do something like this:
    CONSTANTS: q type c value ' .   " << thats a single quote character
    DATA: final_string type string,
              VAL1(12) type c,
              VAL2(12) type c.
    concatenate q val1 '-' val2 q into final_string. .
    How can I define the single quote character as a constant?
    Thanks

    Hello Ed,
    FAQ.
    You can declare single quote as constant
    If you are aware for single quote (') SAP uses an escape character which is the single quote itself('). Hence for every single quote you have to add an additional single quote.
    CONSTANTS: q type c value ''''.
    Suhas

  • Crystal XI R2 exporting issues with double-byte character sets

    NOTE: I have also posted this in the Business Objects General section with no resolution, so I figured I would try this forum as well.
    We are using Crystal Reports XI Release 2 (version 11.5.0.313).
    We have an application that can be run using multiple cultures/languages, chosen at login time. We have discovered an issue when exporting a Crystal report from our application while using a double-byte character set (Korean, Japanese).
    The original text when viewed through our application in the Crystal preview window looks correct:
    性能 著概要
    When exported to Microsoft Word, it also looks correct. However, when we export to PDF or even RPT, the characters are not being converted. The double-byte characters are rendered as boxes instead. It seems that the PDF and RPT exports are somehow not making use of the linked fonts Windows provides for double-byte character sets. This same behavior is exhibited when exporting a PDF from the Crystal report designer environment. We are using Tahoma, a TrueType font, in our report.
    I did discover some new behavior that may or may not have any bearing on this issue. When a text field containing double-byte characters is just sitting on the report in the report designer, the box characters are displayed where the Korean characters should be. However, when I double click on the text field to edit the text, the Korean characters suddenly appear, replacing the boxes. And when I exit edit mode of the text field, the boxes are back. And they remain this way when exported, whether from inside the design environment or outside it.
    Has anyone seen this behavior? Is SAP/Business Objects/Crystal aware of this? Is there a fix available? Any insights would be welcomed.
    Thanks,
    Jeff

    Hi Jef
    I searched on the forums and got the following information:
    1) If font linking is enabled on your device, you can examine the registry by enumerating the subkeys of the registry key at HKEY_LOCAL_MACHINEu2013\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink to determine the mappings of linked fonts to base fonts. You can add links by using Regedit to create additional subkeys. Once you have located the registry key that has just been mentioned, from the Edit menu, Highlight the font face name of the font you want to link to and then from the Edit menu, click Modify. On a new line in the dialog field "Value data" of the Edit Multi-String dialog box, enter "path and file to link to," "face name of the font to link".u201D
    2) "Fonts in general, especially TrueType and OpenType, are u201CUnicodeu201D.
    Since you are using a 'true type' font, it may be an Unicode type already.However,if Bud's suggestion works then nothing better than that.
    Also, could you please check the output from crystal designer with different version of pdf than the current one?
    Meanwhile, I will look out for any additional/suitable information on this issue.

  • Replacing all occurrences of characters in a string with one new character?

    Hi there,
    I'm looking for a way that I could replace all occurrences of a set of specific characters with just one new character for each occurrence.
    For example if I have a string which is "word1...word2.......word3....word4............word5" how would I be able to replace this with just one character such as ":" for each set of "." so that it would essentially appear like this "word1:word2:word3:word4:word5"
    If I just use replace(".", ":") I am left with "word1:::word2:::::::word4::::word5::::::::::::"
    So therefore I'm guessing this would require the use of replaceAll() maybe? but I'm not really very familiar with how regular expressions work and how this would be accomplished using them.
    Any help would be greatly appreciated :) Thanks.

    Yes, but "." means any character, so ".\+" means "any character repeated more than once". If you just mean a full stop ("period" for you Americans :p) you should use "\.+" as your regular expression, but remember that for Java you need a '\' escape to recognise '\' as '\', so in code you'd actually type your regex as:
    "\\.+"Here's an example of one way to do it:
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    public class Test {
        public static void main(String[] args) {
           String string = "example1.......example2...example3.....example4";
         Pattern pattern = Pattern.compile("\\.+");
         Matcher stringMatcher = pattern.matcher(string);
         string = stringMatcher.replaceAll(":");
         System.out.println(string);
    }Edited by: JohnGraham on Oct 24, 2008 5:19 AM
    Edited by: JohnGraham on Oct 24, 2008 5:22 AM

  • Replacing a special character in a string with another string

    Hi
    I need to replace a special character in a string with another string.
    Say there is a string -  "abc's def's are alphabets"
    and i need to replace all the ' (apostrophe) with &apos& ..which should look like as below
    "abc&apos&s def&apos&s are alphabets" .
    Kindly let me know how this requirement can be met.
    Regards
    Sukumari

    REPLACE
    Syntax Forms
    Pattern-based replacement
    1. REPLACE [{FIRST OCCURRENCE}|{ALL OCCURRENCES} OF]
    pattern
              IN [section_of] dobj WITH new
              [IN {BYTE|CHARACTER} MODE]
              [{RESPECTING|IGNORING} CASE]
              [REPLACEMENT COUNT rcnt]
              { {[REPLACEMENT OFFSET roff]
                 [REPLACEMENT LENGTH rlen]}
              | [RESULTS result_tab|result_wa] }.
    Position-based replacement
    2. REPLACE SECTION [OFFSET off] [LENGTH len] OF dobj WITH new
                      [IN {BYTE|CHARACTER} MODE].
    Effect
    This statement replaces characters or bytes of the variable dobj by characters or bytes of the data object new. Here, position-based and pattern-based replacement are possible.
    When the replacement is executed, an interim result without a length limit is implicitly generated and the interim result is transferred to the data object dobj. If the length of the interim result is longer than the length of dobj, the data is cut off on the right in the case of data objects of fixed length. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or hexadecimal zeroes. Data objects of variable length are adjusted. If data is cut off to the right when the interim result is assigned, sy-subrc is set to 2.
    In the case of character string processing, the closing spaces are taken into account for data objects dobj of fixed length; they are not taken into account in the case of new.
    System fields
    sy-subrc Meaning
    0 The specified section or subsequence was replaced by the content of new and the result is available in full in dobj.
    2 The specified section or subsequence was replaced in dobj by the contents of new and the result of the replacement was cut off to the right.
    4 The subsequence in sub_string was not found in dobj in the pattern-based search.
    8 The data objects sub_string and new contain double-byte characters that cannot be interpreted.
    Note
    These forms of the statement REPLACE replace the following obsolete form:
    REPLACE sub_string WITH
    Syntax
    REPLACE sub_string WITH new INTO dobj
            [IN {BYTE|CHARACTER} MODE]
            [LENGTH len].
    Extras:
    1. ... IN {BYTE|CHARACTER} MODE
    2. ... LENGTH len
    Effect
    This statement searches through a byte string or character string dobj for the subsequence specified in sub_string and replaces the first byte or character string in dobj that matches sub_string with the contents of the data object new.
    The memory areas of sub_string and new must not overlap, otherwise the result is undefined. If sub_string is an empty string, the point before the first character or byte of the search area is found and the content of new is inserted before the first character.
    During character string processing, the closing blank is considered for data objects dobj, sub_string and new of type c, d, n or t.
    System Fields
    sy-subrc Meaning
    0 The subsequence in sub_string was replaced in the target field dobj with the content of new.
    4 The subsequence in sub_string could not be replaced in the target field dobj with the contents of new.
    Note
    This variant of the statement REPLACE will be replaced, beginning with Release 6.10, with a new variant.
    Addition 1
    ... IN {BYTE|CHARACTER} MODE
    Effect
    The optional addition IN {BYTE|CHARACTER} MODE determines whether byte or character string processing will be executed. If the addition is not specified, character string processing is executed. Depending on the processing type, the data objects sub_string, new, and dobj must be byte or character type.
    Addition 2
    ... LENGTH len
    Effect
    If the addition LENGTH is not specified, all the data objects involved are evaluated in their entire length. If the addition LENGTH is specified, only the first len bytes or characters of sub_string are used for the search. For len, a data object of the type i is expected.
    If the length of the interim result is longer than the length of dobj, data objects of fixed length will be cut off to the right. If the length of the interim result is shorter than the length of dobj, data objects of fixed length are filled to the right with blanks or with hexadecimal 0. Data objects of variable length are adapted.
    Example
    After the replacements, text1 contains the complete content "I should know that you know", while text2 has the cut-off content "I should know that".
    DATA:   text1      TYPE string       VALUE 'I know you know',
            text2(18)  TYPE c LENGTH 18  VALUE 'I know you know',
            sub_string TYPE string       VALUE 'know',
            new        TYPE string       VALUE 'should know that'.
    REPLACE sub_string WITH new INTO text1.
    REPLACE sub_string WITH new INTO text2.

Maybe you are looking for

  • If I have a 10% Gross Margin formula can I change one task to calculate at 15%

    I am working in MS Project 2010 Pro, I have set a column with a custom field to a 10% Gross Margin formula, is there a way I can change one task to a 15% Gross Margin formula? I am also having a problem opening two project schedules at once, for some

  • How much to change the screen

    I lost my iphone5 this summer, so I just upgraded my contrat with AT&T and got my iphone5s in October. But it accidently fell to the ground today and the screen was broken!! I am too sad now. How much will it take to replace a new screen?

  • Creating a delivery doc with serial numbers

    Hi all, I need to create a delivery doc with the corresponding serial numbers? Any BAPI/function module for this?

  • How to execute program in remote server?

    In my code I am executing a program that resides on another server. But when I execute the program the server where the code is resided runs the program and sucks up CPU. How can I make it execute the program in the remote server? I don't want it to

  • IPhoto 5.0.4 Grey thumbnails

    upgrade to iPhoto 5 shows 1900 grey thumbnails and 100 pictures in my library from iPhoto 4 with 2000 photos I rebuilt the iPhoto library and have 1900 grey thumbnails and 2000 photos the albums if selected bring up the grey thumbnails Anyway I can f