Preview shows some text incorrectly in pdfs

I have recently had problems viewing pdfs in Preview. This applies to new pdfs that I have downloaded as well as old ones that were already on my computer. I am a graduate student in biology, so I download and read many scientific articles as pdfs on my 2.4 GHz MacBook.
I think the problem may have started when I did the 10.5.6 system update.
Here's the problem:
Preview substitutes incorrect letters or symbols for some letter combinations. It seems to have particular trouble with the letter 'f' with other letters. For example in one pdf...
"field" becomes "Weld"
"difficulties" becomes "diYiculties"
"configuration" becomes "conWguration"
"flightless" becomes "Xightless"
"flat" becomes "Xat"
"effective" becomes "eVective"
In another pdf...
"flow" becomes "£ow"
"floral" becomes "£oral"
"field" becomes " ¢eld"
These errors were also present when it printed.
And finally in another...
"field" becomes "Æeld"
"influence" becomes "inØuence"
"fig" becomes "Æg"
This happens if I view the pdf in Safari using Preview or in Preview itself (Version 4.1 (469.4)). Suggestions?

sounds like a font problem. open Font Book and validate all fonts and resolve duplicates. also, clear Font caches using a3rd party app like Font Finagler or Onyx.

Similar Messages

  • Preview not showing some text in certain PDFs

    I've had issues with a couple of PDFs this year that did not display correctly in Preview, but are viewable in Acrobat Reader. An example is here on pages 31-36. Preview shows blank gridlines, but Acrobat Reader shows text and numeric data in those cells. It appears Adobe may have enabled some kind of text flag that Preview is ignoring in one of their authoring programs?

    An example is [here|http://www.fs.usda.gov/Internet/FSE_DOCUMENTS/stelprdb5227378.pdf] on pages 31-36. Preview shows blank gridlines,
    I tried downloading the pdf file at that link, and in my system Preview displays those pages properly:
    You might try running the [OS X v10.6.6 combo update|http://support.apple.com/kb/DL1349] - it contains some updated Preview components which might include something that is currently missing in your system.

  • Show some text messages in a popup window.

    I have a requirement to show some text in a pointed popup window (similar to a pointed tooltip) when a commandLink is clicked. The text consists of 2-3 lines. What can I use?
    I guess <af:popup> doesnt show up as a pointed tooltip.

    Use an ad:popup and put an af:noteWindow in there.
    Check out http://docs.oracle.com/cd/E21764_01/apirefs.1111/e12419/tagdoc/af_popup.html
    Timo

  • Previewing Pages document in Preview shows page numbers incorrectly

    Previewing Pages (5.2) document in Preview (7.0) shows page numbers incorrectly. Regardless of starting page number preview shows as Page 1.
    Suggestions appreciated...

    That appears to be YABIP5 (Yet Another Bug In Pages 5].
    Pages .09 documents are fine.
    No prizes however for finding bugs in Pages 5/5.2 it's swarming with them.
    Peter

  • While adding hyperlinks, is there a way to show some text before opening the hyperlinked page?

    From my help file, I need to add a link to an external source on the web. Is there a way for me to show some message like "You are being redirected to an external page" and when the use clicks the OK button in the message, the actual hyperlinked page is opened?
    Thanks in advance.

    Hi,
    This is a two step process. In your project add a topic with the disclaimer text. Add a hyperlink to the external site and add an refresh meta tag: http://webdesign.about.com/od/metataglibraries/a/aa080300a.htm
    In you project, link to the disclaimer topic instead of the external site.
    Greets,
    Willam

  • IE 10 not showing some text on Table

    Some of the texts are not shown on IE10 mode. This occurs on random cells. On page refresh also this occurs again on any other cells randomly. But these texts are shown while selecting IE9 mode on Internet Explorer.
    I can see those data on source code. And if I copy and paste on Notepad that table data I can the text  for all the cells.
    How to solve this. I need solution for this as soon as possible.
    I have used the following code for the above table:
    <table cellspacing="0" border="1" style="border-collapse: collapse;" align="center">
        <tr class="gr_hdr">
            <td>
                Meter
            </td>
            <td>
                Field
            </td>
            <td>
                Value
            </td>
        </tr>
        <asp:Repeater ID="DataRepeater" EnableViewState="false" runat="server">
            <ItemTemplate>
           </ItemTemplate>
        </asp:Repeater>
    </table>
    CSS used
    .gr_hdr
        background-image: url(../img/grd.gif);
        font-family: Verdana, Arial, Helvetica, sans-serif;
        font-size: 11px;
        font-weight: bold;
        color: #660000;
        background-color: #845446;
        height:24px;
        text-align: center;

    Hi Rob,
    Thanks for the response.
    I checked and the Trace Styles tab does not show the cell having "display:table-cell" style.
    This web application uses a standard css to define styles for a <td> tag as such:
    td {font-family: Arial; font-size: 8pt;}
    if I add the style you have mentioned as such
    td {font-family: Arial; font-size: 8pt; display:table-cell;}
    It still does not show up when I select the <td> cell and check the "Trace Styles" tab.
    Am I using the "display:table-cell" incorrectly? Where else should I specify it?
    The HTML for the whole web page is huge so I am including just the HTML of the affected part of the page:
    <tr>
    <td align=center>
    <table border=1 bgcolor=white cellspacing=0 cellpadding=2 width=100%>
    <tr valign=bottom class=tableTitle2>
    <td rowspan=3 width=20% colspan=2>Queue Name</td>
    <td colspan=3 rowspan=2 width=35% align=center>Applications</td>
    <td colspan=5 align=center width=45%>Pend Assignments</td>
    </tr>
    <tr valign=bottom>
    <td colspan=3 align=center><b>Assigned To Queue</b></td>
    <td colspan=2 bgcolor=white align=center><b>Assigned From Queue</b></td>
    </tr>
    <tr valign=bottom class=darkHeader>
    <td align=center >Unassigned</td>
    <td align=center >To Me</b></td>
    <td align=center >To Others</td>
    <td align=center>Unassigned</td>
    <td align=center >To Me</td>
    <td align=center>To Others</td>
    <td align=center>By Me</td>
    <td align=center >By Others</td>
    </tr>
    <tr>
    <td
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=19&rnd=560d1478-2c5a-493a-a18e-034ad6599405'>
    <b>Enrollment</b></a>
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camQueueUserAdmin?camQId=19&rnd=790040a0-570c-4429-91c0-7a9d030a174e'>
    <img src=https://Some.Corp.Url/images/cam/queueadmin.gif align=absmiddle border=0 alt='Maintain Users in this Queue'></a>
    </a>
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=19&category=1&rnd=d03bedaa-cb47-40ed-9fce-f04939b2d60e'>
    19</a>
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=19&category=3&rnd=638bea64-72a1-483e-9081-1ad803cc1e7a'>
    155</a>
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=19&category=7&rnd=cf5f4985-7a6e-4319-a104-f6beb9ecca59'>
    1</a>
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=19&category=8&rnd=1ed0ee0a-6d8f-497e-b1eb-4a15b008df6c'>
    113</a>
    </td>
    </tr>
    <tr>
    <td
    bgcolor=#EDEDED
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=22&rnd=38f71731-0658-4f90-b899-031f5cc3e225'>
    <b>Introduction Call</b></a>
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    <a href='https://Some.Corp.Url/cam/camQueueUserAdmin?camQId=22&rnd=bbbb06e5-8bd1-401a-8c32-881b71eac952'>
    <img src=https://Some.Corp.Url/images/cam/queueadmin.gif align=absmiddle border=0 alt='Maintain Users in this Queue'></a>
    </a>
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=22&category=1&rnd=0e871bc7-64bf-4ddf-877a-96a48328e604'>
    14</a>
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    0
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=22&category=3&rnd=d2a512eb-aa5c-4b72-9f9f-87b52bc6aebe'>
    57</a>
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    </tr>
    <tr>
    <td
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=27&rnd=30b5f89c-be4b-4525-b3ee-0afbe4df85c7'>
    <b>Tax Set-Up</b></a>
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camQueueUserAdmin?camQId=27&rnd=72873a74-75ad-4a6a-bca4-a8de0b5165e5'>
    <img src=https://Some.Corp.Url/images/cam/queueadmin.gif align=absmiddle border=0 alt='Maintain Users in this Queue'></a>
    </a>
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=27&category=1&rnd=91be337e-3232-4a89-87a9-5b3ba1ed5ccf'>
    3</a>
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    </tr>
    <tr>
    <td
    bgcolor=#EDEDED
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=17&rnd=8153a964-1403-4345-ae67-f0ebf263b981'>
    <b>Implementation</b></a>
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    <a href='https://Some.Corp.Url/cam/camQueueUserAdmin?camQId=17&rnd=3d532f7b-3ed7-4e2a-8056-af32acd0ce44'>
    <img src=https://Some.Corp.Url/images/cam/queueadmin.gif align=absmiddle border=0 alt='Maintain Users in this Queue'></a>
    </a>
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    0
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    0
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=17&category=3&rnd=697c0e1a-2d28-42e8-a204-5b1f3a70262f'>
    112</a>
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=17&category=7&rnd=15c11294-cd7f-4cac-add6-2dd27c99b1fb'>
    3</a>
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    </tr>
    <tr>
    <td
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=28&rnd=6d57a566-07d0-45ec-9f35-e4ad1bd15e60'>
    <b>Tax QA</b></a>
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camQueueUserAdmin?camQId=28&rnd=818cad70-e7e0-47fb-a4d0-c30170dfeb24'>
    <img src=https://Some.Corp.Url/images/cam/queueadmin.gif align=absmiddle border=0 alt='Maintain Users in this Queue'></a>
    </a>
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=28&category=1&rnd=2945c092-c06e-4e33-85e6-f5967efa5256'>
    5</a>
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=28&category=3&rnd=b9538200-588f-4385-86fe-7d33f2841072'>
    11</a>
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=28&category=7&rnd=72c3073f-cc11-42b2-9164-d98ab4e1858a'>
    1</a>
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=28&category=8&rnd=453825e3-db85-44d4-87b5-c5c970c8c9d4'>
    3</a>
    </td>
    </tr>
    <tr>
    <td
    bgcolor=#EDEDED
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=13&rnd=fd8957c6-1ae2-4aa7-8fc0-a88be1e99620'>
    <b>Implementation QA</b></a>
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    <a href='https://Some.Corp.Url/cam/camQueueUserAdmin?camQId=13&rnd=95a425a7-2271-4fec-aa86-0910f9b5928b'>
    <img src=https://Some.Corp.Url/images/cam/queueadmin.gif align=absmiddle border=0 alt='Maintain Users in this Queue'></a>
    </a>
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    0
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    0
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=13&category=3&rnd=847fbc95-0660-45b3-9ee2-0eb85b362efb'>
    601</a>
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    </tr>
    <tr>
    <td
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=14&rnd=2499ce88-8f1f-4cd5-875e-4d482ad127ea'>
    <b>1st Processed</b></a>
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camQueueUserAdmin?camQId=14&rnd=352273f4-976e-43cb-9c3e-a35a81ae8d4e'>
    <img src=https://Some.Corp.Url/images/cam/queueadmin.gif align=absmiddle border=0 alt='Maintain Users in this Queue'></a>
    </a>
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=14&category=3&rnd=6be1692f-cbb0-48c3-baf4-f17b80e04d81'>
    420</a>
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=14&category=8&rnd=2b98e623-c93c-4532-ab26-5c4abc34fde2'>
    3</a>
    </td>
    </tr>
    <tr>
    <td
    bgcolor=#EDEDED
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=12&rnd=e8a8dfec-fdee-40da-b7d9-9c2a803dd039'>
    <b>1st Processed QA</b></a>
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    <a href='https://Some.Corp.Url/cam/camQueueUserAdmin?camQId=12&rnd=c2b39342-cc40-4253-ac8a-1cf16397d24c'>
    <img src=https://Some.Corp.Url/images/cam/queueadmin.gif align=absmiddle border=0 alt='Maintain Users in this Queue'></a>
    </a>
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    0
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    0
    </td>
    <td align=center
    bgcolor=#EDEDED
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    <td align=center
    class='otherGrey'
    >
    0
    </td>
    </tr>
    <tr>
    <td
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=34&rnd=2e37d520-5ec1-435f-93f5-7c1a64fe2ee8'>
    <b>Account Manager</b></a>
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camQueueUserAdmin?camQId=34&rnd=cea88295-1b5a-4948-b79e-b82c1919de94'>
    <img src=https://Some.Corp.Url/images/cam/queueadmin.gif align=absmiddle border=0 alt='Maintain Users in this Queue'></a>
    </a>
    </td>
    <td align=center
    >
    <a href='https://Some.Corp.Url/cam/camAppPendQList?camQId=34&category=1&rnd=f618b964-5a6f-4b0c-9ff2-a2b614c847aa'>
    22</a>
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    <td align=center
    >
    0
    </td>
    </tr>
    </table>
    </td>
    </tr>
    Its always the <td> tags with the numeric data in them that disappear.
    Please let me know if I should declare the style for every <td> tag? I was under the impression that this style was only relevant for displaying tabular data within <div> tags.
    Besides this, is there anything else I can do to mitigate this issue? It is quickly escalating with our customers.
    Thanks for all your help.
    Ahmad

  • Mac Preview showing gibberish text

    Hi,
    Can someone please help me? I am frustrated by Mac's Preview program showing either gibberish or nothing in a .pdf. When the same text is opened in Acrobat, it is clear (see picture below).
    I've tried embedding fonts in Acrobat files so Preview can open them, but it still doesn't seem to work. Any suggestions?
    Thank you!

    Hi,
    I would try turning Off the Text Forwarding then turning it On again and see if this causes the Mac to show the Code number (it will be a new one)
    When I had a similar issue (without an iPad in the Mix) I had to repeat the process twice to get the Mac to show a new code.
    9:04 pm      Sunday; February 8, 2015
    ​  iMac 2.5Ghz i5 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • Blank page sent to my printer..Print Preview shows my page as a .pdf (On Mac OS 10.5.8)

    A blank page is sent to the printer. When I view the text page in Print Preview, the page is blank and it is a .pdf. The print feature works fine with other browsers. This suddenly occurred. One minute I was able to print...the next minute blank pages print. I have tried two different printers and both experience the same problem on Firefox. The plug-ins are up to date.
    Thanks, in advance, for any help.

    Slow down a bit and think this through.
    CUPS on linux is nearly identical to CUPS on OS X - but there is no Mac-to-Mac Apple proprietary print sharing. Rather, on linux you are sharing the printer using standard printing protocols. Just like on the Mac (when using the standard protocols like Windows/SMB or IP printing), linux print queues expect postscript input. Try using a generic postscript driver from the mac.
    And when you add the printer via Windows Printing or IP > LPD or IPP, you will need to know the queue name for that printer from the linux box. (one computer with one IP address can have multiple printers - so what's the additional address info to print to your desired printer? - queue name.)
    HTH

  • Show some text when mouse hover over a component

    Hi,
    I would like to show a couple of lines of text, just to the right hand-side of the component (kind of a mini-pop up menu) everytime the mouse hovers on that component. The focuslistener is in place and working, but I don't know how to implement this 'popup' menu. I don't need to select any of the lines or perform any action on them, just showing them
    thanks

    thanks, that's the component I was looking for (assuming I can now change the fonts, colour etc)
    I have done the following and it kind of works: it should highlight the text and show the tooltip. However, it kind of gets stuck every now and then...two things: it takes some time before the tooltip appears (1 sec): is there a way to make it immediate, simultanous to the highligh? also, I have a few Jtextfield, as you may remember..as I hover the mouse over each of them, it all works fine, but when I go back to a jtextfield previously hovered over and highlighted, nothing happens, until I randomly click around and then works again. Any ideas? thanks a lot
    myJTextField.addMouseListener(new MouseAdapter(){
                     public void mouseEntered(MouseEvent e) {
                        ((JTextField) e.getSource ()).requestFocus();
                        ((JTextField) e.getSource ()).selectAll(); // highlight the text
                        ((JTextField) e.getSource ()).setToolTipText("text");
                       

  • Safari not showing some text on phpBB3 Forum

    When I go to the main page on my forum using Safari, where it says "no new posts" at each section it shows up as a box with a blue question mark as if it's an image. When I go to the same page using any other browser, camino, firefox etc it shows up as text. There is no image there and I don't know why safari is looking for an image??
    If I ctrl click on the question mark and copy image address it gives me an address that is a resulting 404 not found.
    My forum is www.mezerik.com/forum Please any safari user have a look and tell me if you get the blue question mark.
    Any ideas why this is happening and how it can be fixed. It only happens on that website.

    When I go to the main page on my forum using Safari, where it says "no new posts" at each section it shows up as a box with a blue question mark as if it's an image. When I go to the same page using any other browser, camino, firefox etc it shows up as text. There is no image there and I don't know why safari is looking for an image??
    If I ctrl click on the question mark and copy image address it gives me an address that is a resulting 404 not found.
    My forum is www.mezerik.com/forum Please any safari user have a look and tell me if you get the blue question mark.
    Any ideas why this is happening and how it can be fixed. It only happens on that website.

  • Web Page: IE vs Safari. Safari won't show some text!

    I use my windows desk top with front page to create a website. When viewing from IE window computer, the verbiage under special notice shows up clearly and consistently. When viewing the same page using Safari, the verbiage under the Special Notice section does not show up.
    1. I redid the web page moving the pictures around etc. but the same problem occurrs.
    http://bergen.edu/faculty/whuisking/
    Is the site. I am at a real loss.

    No problem, Skip, and, although I have never used Front Page, I'll try to give you a little guidance; because, "Yes", the change should be made to look exactly as I showed it in the original post.
    -- The CSS definition is in your style sheet.
    -- Your style sheet is a file named <code>blit1011.css</code>.
    -- It is found in your <code>faculty/whuisking/_themes/blitz/</code> directory on your web site.
    If you can locate and open that file directly through Front Page, you would do a find for: <code>TABLE{</code> (that's a left "curly bracket") and do one of the following:
    a) delete the line that says "color:transparent;" or
    b) comment out that line exactly as posted, originally.
    -- That method, again, is: <code>/color:transparent;/</code> . Anything between /* and */ is commented out, meaning ignored.
    If, on the other hand, you have FTP, you can download that file, save it as its original name, that is <code>blit1011.css</code>; and then go in, change the code as describe above, save, and upload the file. Then test.
    If you are stuck, there should be some folks around who are familiar with Front Page, and can assist you with changing the style sheet. Keep us apprised.

  • Best way to determine optimal font size given some text in a rectangle

    Hi Folks,
    I have a preview panel in which I am showing some text for the current selected date using a date format.
    I want to increase the size of the applied font so that it scales nicely when the panel in which it is drawn is resized.
    I want to know the best way in terms of performance to achieve the target. I did some reading about AffineTransform and determining by checking ina loop which is the correct size, but it does not feel like a good way.
    I would appreciate some tips.
    Cheers.
    Ravi

    import java.awt.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class ScaledText extends JPanel {
        String text = "Sample String";
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            Font font = g2.getFont().deriveFont(16f);
            g2.setFont(font);
            FontRenderContext frc = g2.getFontRenderContext();
            int w = getWidth();
            int h = getHeight();
            float[][] data = {
                { h/8f, w/3f, h/12f }, { h/3f, w/4f, h/8f }, { h*3/4f, w/2f, h/16f }
            for(int j = 0; j < data.length; j++) {
                float y = data[j][0];
                float width = data[j][1];
                float height = data[j][2];
                float x = (w - width)/2f;
                Rectangle2D.Float r = new Rectangle2D.Float(x, y, width, height);
                g2.setPaint(Color.red);
                g2.draw(r);
                float sw = (float)font.getStringBounds(text, frc).getWidth();
                LineMetrics lm = font.getLineMetrics(text, frc);
                float sh = lm.getAscent() + lm.getDescent();
                float xScale = r.width/sw;
                float yScale = r.height/sh;
                float scale = Math.min(xScale, yScale);
                float sx = r.x + (r.width - scale*sw)/2;
                float sy = r.y + (r.height + scale*sh)/2 - scale*lm.getDescent();
                AffineTransform at = AffineTransform.getTranslateInstance(sx, sy);
                at.scale(scale, scale);
                g2.setFont(font.deriveFont(at));
                g2.setPaint(Color.blue);
                g2.drawString(text, 0, 0);
        public static void main(String[] args) {
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new ScaledText());
            f.setSize(400,400);
            f.setLocationRelativeTo(null);
            f.setVisible(true);
    }

  • Show standard texts on document

    Hi all,
    Our customers have the need to show some text on the bottom of some documents (invoice, order confirmation). Normally, I would use SO10 for the text. No problem there.
    In general, those texts have a limited time in which they should be printed on the documents. Is there a way (or table) in which you can define texts as well as a start date and/or an ending date?
    Any other solution is also welcome
    Thanks.

    Hi Karin,
    it just depends on what date is the correct one to check. Todays date is in SY-DATUM always included and always available.
    In your case, it is a invoice and I can imagine that the VBRK-ERDAT (date when the invoice is created) or even the VBRK-FKDAT (date when the invoice is booked) maybe also a good solution.
    Both fields are included in the structure VBDKR by the way
    For your order confirmation have a look in table VBAK / VBDKA. The fields there are ERDAT and AUDAT I think.
    The select statement should look something like that:
    Select single ... from     yourtable
                            into     yourstructure
                            where datefrom <= sy-datum
                               and dateto    >= sy-datum.
    IF sy-subrc = 0.
    *whatever you want to do now
    ENDIF.
    ~Florian

  • Just installed mountain Lion. Viewing a pdf sent to me using preview and some colors are appearing BLACK, however when I view the same PDF in Acrobat they are perfect and what they are suppose to be. WHY would PREVIEW showing a different color?

    Just installed mountain Lion. Viewing a pdf sent to me using preview and some colors are appearing BLACK, however when I view the same PDF in Acrobat they are perfect and what they are suppose to be. WHY would PREVIEW showing a different color?

    Here's what I've found on the issue:
    Pantone color definitions have changed (coinciding with CS6) — they are now "Pantone+" (I think that's what they're called). The "+" apparently means they're now LAB colors. Lab colors are not properly displayed in Preview (or in Finder previews) — they display as black (as far as I can tell, in all circumstances). I'm sure it's a tad more complicated than that, but that's the gist.
    Now the bad news — nobody seems to know anything about a fix or workaround (unless you convert your PDFs to process — this might be a fix for sending to clients). It causes issues for me in AI files — being able to view them in the finder (with previews) is a HUGE time saver for my workflow... when they're all black, not so much.
    In my chat with a director of product dev at Adobe, they placed the responsibility to fix on Apple (assuming Apple wants to support Pantone color definitions in their OS).

  • Preview (copy text) results in SQUIGGLES not text for certain PDFs

    hi - problem is "copy text and paste from certain PDFs result in squiggles
    When i use an online converter service (e.g. http://ebook.online-convert.com/convert-to-pdf) to convert files to PDF, Apple Preview does not work properly.
    What happens is, when I view this PDF and highlight the text to copy in Apple Preview (snowleapard 10.6.x), and then paste the text say in an email / text file or word doc ---- i get squiggles NOT text.
    However, if I view this same PDF in Adobe Pro, I get text (copy text and paste works)
    I can also view this same PDF in my iphone app, Goodreader, and "copy text and paste) to email works e.g.  I get text.
    Interestingly, if I create the PDF NOT from this online service, but say from Adobe PRO, Apple PReview works (e.g. I copy and paste the text no issue)
    is this a known bug of Apple Preview or is there some setting i must change somewhere?
    the support/developer dude of the online service keeps telling me its an Apple Preview problem, not a problem of his service.....
    thankyou in advance for your help.

    An example is [here|http://www.fs.usda.gov/Internet/FSE_DOCUMENTS/stelprdb5227378.pdf] on pages 31-36. Preview shows blank gridlines,
    I tried downloading the pdf file at that link, and in my system Preview displays those pages properly:
    You might try running the [OS X v10.6.6 combo update|http://support.apple.com/kb/DL1349] - it contains some updated Preview components which might include something that is currently missing in your system.

Maybe you are looking for