Embed fonts when adding a watermark

Acrobat 8.1:
Please help me embed a font when adding a watermark. I'm using the addwatermarkastext() method, using C#:
args = new System.Object[] { text, 1, fontName, size, jsoColor, -1, -1, true, true, true, horizontalAlign, verticalAlign, horizontalValue, verticalValue, false, 1.0, false, watermarkRotation, 1.0 };
jso.GetType().InvokeMember("addWatermarkFromText", System.Reflection.BindingFlags.Default | System.Reflection.BindingFlags.InvokeMethod, null, jso, args);
This works great, but I need to embed the font into the PDF. I'm using a barcode font that must be embedded, since the downstream viewer is not acrobat reader (and the user may not have the barcode font installed) and has a hard time with non-standard fonts. We are using a barcode font with an free license, so licensing won't be an issue.
When I add a watermark manually through the Acrobat pro interface, Acrobat DOES embed the font. I can't rely on users to enter the information accurately, so I must have an automated solution.
Is there a setting on Addwatermarkfromtext that I'm missing, or is there another way to embed just that one font? I don't want to embed all fonts in the document, just the barcode font.
I've tried adding a dummy watermark with text that is not visible (I saw somewhere online that someone recommended this approach). It did not work..

addWatermarkAsText() will always embed the font, provided that the font is licensed for embedding. have you verified that the font vendor has granted you those rights? I know you said it's "free", but perhaps it's not embeddable. You can easily check that using Distiller or the Microsoft Font Panel.
If you were to upgrade to Acrobat 9, then there is an EmbedFont function you use to embed just that font after the fact - though, again, it shoudl be embedded as is.

Similar Messages

  • Prevent all page color from becoming opaque when adding a watermark with opacity

    It looks like when I create a watermark AND change the opacity to something low the entire PDF becomes slightly opaque and colors are not that vivid (even if the actual text watermark is very small in the corner).
    The only way I noticed fixes this problem is if I check the option to "Keep position and size of watermark text constant when printing on different page sizes".
    See difference here:
    -- Normal - http://screencast.com/t/5bCfSP5Fba
    --Opaque - http://screencast.com/t/03qXJhR1ydh
    --This is the difference in black when zooming in: http://screencast.com/t/PPsMJiLiS
    Does anyone know what could be causing this? Is there a way to fix it without checking "Keep position and size of watermark text constant when printing on different page sizes"?
    Thanks!

    ALMOOOST!
    It did work but I don't understand why it worked on some pages and not on others. So when using this method, its worked completely fine when the watermark is applied to visible page. However, when the watermark is applied only to printed pages, some of those pages lose the water mark completely on print during the flatten/change blend space. I cant tell whats special about those pages that it works that way.
    Maybe it will be just easier to use the "Keep position and size of watermark text constant when printing on different page sizes" option when adding the watermark and then everything looks evenly perfect(just need to manually center the watermark position for each file). Curiously though, any idea what could be the correlation between the "Keep position and size of watermark text constant when printing on different page sizes" and the opacity of page when adding an watermark?

  • Solution to "Black image when adding a watermark in Aperture"

    Hi,
    I read an archived topic about people having issues with adding a watermark to their exported images using Aperture 1.5.2. I think the solution lies with what your current Display color profile (System Preferences > Display > Color) is set to and what color profile you used to create your watermark.
    I created my original watermark using Photoshop CS2 and I believe that the watermark was saved using the sRGB Profle. However, I then calibrated my monitor using a Pantone Huey and it changed the color profile in my System Preferences. So every time I tried to export an image with a watermark from Aperture, I would get a black image with my watermark in the correct spot.
    To solve the problem, I changed my Color Profile to sRGB Profile, then started Aperture. When I exported my image, everything came out properly.
    Hope this is helpful to others.

    I also just ran into this problem...my solution was an issue with the RAW fine tuning.
    Images that used the new RAW fine tuning 2.0 (with Aperture 2) exported watermarks (I used a .psd file) just fine, but when exporting images with RAW fine tuning 1.1, a black box would show up around my watermark. So I migrated my images to RAW fine tuning 2.0 and it fixed the black box issue.

  • Embed fonts when saving as eps

    Hi
    When saving a file as an illustrator eps I would like the default option to NOT embed fonts.
    Does anyone know if this is achievable and, if so, how to do it?
    Cheers
    Wayne

    Hi John
    Thanks for your input.
    I'm aware of the benefits of embedding fonts in Illustrator files but, to cut a long story short, files with fonts embedded show up as an error when put through the flightcheck application program. (And I have tailored the Ground Controls to suit including disabling the embedding fonts option.)
    Kind regards
    Wayne

  • When adding a watermark, Lightroom crashes

    Anytime I try to export a file and add a watermark, Lightroom crashes.  I can export without adding a watermark just fine.  Lightroom also crashes when I try to edit a current watermark - as soon as I click the drop down menu to choose which watermark to edit, down goes Lightroom.  I have both text watermarks and a small jpeg as a watermark (same thing happens with both) and I am running Lightroom 4.3.

    It does sleep eventually, but not while I'm using the watermark feature? And it's not like I move the file around, it stays put. At any rate, I've moved it over to my internal hard drive to test that theory and it seems to be working thus far
    As a side note, I'm wondering if it's ok that my raw files are on my internal hard drive but the catalog is on my external? When I import new images, they go to my "Pictures" folder by default but the catalog itself is located on my external. So when I back it up, it backs up to my external, which is the whole point...but since I wasn't sure if you're supposed to be referencing the files from the same place and THEN backing them up somewhere separate? Sorry if that's confusing!

  • Fully embed fonts when saving as PDF

    Hi,
    I am saving an Illustrator file as PDF and in the Save As PDF settings dialogue pages, no matter what I do regarding fonts, the final PDF file always outlines some of the fonts instead of embedding it.
    (I tried various settings for "Subset fonts when percent of characters used is less than XX%" including 0%, 1%, or 100%, it didn't make any difference)
    Is there a way to force Illustrator into embedding fonts when saving as PDF?
    Thanks.

    Monkia/Steve,
    I followed up on another thread and it turned out this one joins the discussion there.
    http://forums.adobe.com/message/6246758#6246758
    I made some additional tests and we concluded there that Save As PDF and Print to PDF from Illustrator do not work the same way. It doesn't solve my problem but it certainly helps move in the right direction...

  • Moving from Bridge to Lightroom, when adding existing files on hard drive, will metadata transfer? Should I choose embed sidecar in file handling or will it automatically happen if I choose standard?

    Moving from Bridge to Lightroom. Will metadata in existing files be recognized by Lightroom, and should I select embed+sidecar when adding files to library for the first time.

    Thanks guys, appreciate the feedback.
    CHRIS - you are exactly right about my FUTURE workflow. What I'm trying to figure out now is how to best handle images already processed. My import should be OK based on the way I have duplicates in separate directories, BUT I'm wondering how to avoid seeing all of these duplicates in LR when I search by keyword, etc.? I guess I can somehow flag the RAW files and only get them in my results.
    One question though - Stacks, etc. sounds great for the LR processed images. But what about variations based on processing in Photoshop after the LR Develop stage? I guess in this case I will just have to keep duplicate images if I have multiple versions from my PS work?
    ISAAC - Thanks for clarifying that LR will recognize my XMP files from Bridge. What about the opposite direction . . . if I edit something in LR and capture this via XMP, it won't prohibit Bridge from recognizing XMP info if I access a file via Bridge, will it?
    ALSO - Do you know where I can find info about tracking via XMP vs. the central database? You mentioned a couple of valid points, but I'm not sure I have a full handle on the pros/cons of these options.
    Thanks!
    Mark

  • Not embed fonts saving as pdf

    Hi everyone
    Just a quick question.. before I start to dig myself.
    We save our LC design forms in the source format .xdp. When we publish them we select File > saveAs and choose dynamic pdf.
    but LC designer will always embed fonts in the pdf. We have to open our pdf in LC designer a remove 'embed font' under File > Form properties (this can only be fone to a pdf, so we need an additional save as ZZZZZZZ).
    Question:
    Anyone have solution on setting LC designer ud to not embed fonts when saving and xdp to dynamic pdf? is the a config file or registry setting to edit?
    help is very welcome
    Regards
    Thomas Groenbaek, Form Expert
    Jyske Bank

    hi Jyske,
    What you can do is to add the following line in the .tds (template) files that Livecycle uses:
    <?templateDesigner SavePDFWithEmbeddedFonts 0?>
    and this just before the closing </template> element in the xml source.
    You find these templates in the <Livecycle Designer Installation folder>\EN\Templates
    Regards
    RonnyR

  • Embed Fonts converting xdp to pdf

    Hi,
    I saved some documents as xdp files. I need now to generate pdf files form it using LiveCycle Forms, how can I make LiveCycle Forms to embed the fonts into the generated pdf?
    Thank you

    Hi Neptas,
    It's been a long time since you posted this message but do you still remember how do you embed fonts when using LiveCycle?
    Thanks.

  • In "Previews" when adding text to a picture I can't change the font, even though a few days ago I could.  How do I fix this?

    In "Previews" when adding text to a picture I can't change the font, even though a few days ago I could.  How do I fix this?

    kgwrotethis wrote:
    10.6
    Use Software Update to update your os to 10.6.8 and anything else that needs to be updated.  After the installations go to /Library/Preferences - trash the com.apple.Preview.plist file.  Repair permissions, restart your computer and empty the trash.  Your Preview issue should now be resolved.

  • When unchecking 'embed fonts' hyperlinks go away.

    LiveCycle 9.  When I reload a pdf that was generated by LC, and go to: Form Properties | Save Options, and uncheck the "embed fonts" checkbox, all the hyperlinks in the form dissapear.
    This is a secondary process after the form has been initially saved with the fonts. (Apparently, there is no way to generate a pdf from xdp without embedding the fonts.) All I want to do is remove the embedded fonts. The fonts do unembed and all the field functions and scripts still work.
    Do I need to wait to install the hyperlinks at this stage of the process?
    Or is there another solution?
    Thanks

    Interesting.   These old forms use embedded Arial for both static and fillable fields. We have always embedded Arial, but now want to reduce our file sizes and Arial is available everywhere in our system.
    If I load an old pdf, save as xdp and generate a new pdf form the xdp (with the grayed out "embed fonts"), the resulting form does have embedded Arial.  That's why we reload the newly generated pdf form back in to LC and then we can uncheck the "embed fonts". This form then, when saved, gives us a pdf form without Arial embedded.  It also has no hyperlinks...they have all been removed by the process. 
    Wendell

  • Acrobat Pro 9.3 crash when adding watermark

    Hi All, my acrobat crash when I add watermark.  I am running Window 7 and have check the compatibility box thinking this will resolve the issue.
    Any solution to this issue?

    Acrobat Pro 9.4.2 (CS5) is doing the same thing on my Windows XP SP3 with 3.5 GB of ram and 206 GB of my brand new 300 GB hard drive free.
    It starting doing this at the end of last year before my hard drive died.  Then after rebuilding the entire system on this new drive it worked fine, until I downloaded all the updates and now it is broken again.  Anytime I open more than one PDF, Acrobat crashes.  I send the error report every time.

  • When adding fonts where SHOULD they be placed

    It seems that fonts can be added to the two font folders as well as Font Book. I like to keep related items together, but fonts in the system library cannot (?) be put into font book, and if fonts are added to the system library what good is Font Book? Also what fonts are necessary in the system font list? It seems that the foreign language files could be deleted - or not?

    Every font in system font is necessary, that's why they are in system font.
    For managing fonts, just use font book, and let the system fonts as they are. Font book also just handels the Library Font and Personal Font folder.
    Message was edited by: Stress Test

  • Embed fonts not available error (But they are available sysetm fonts)

    Hello!
    I tried to search and actually did found some answers regarding font problems, but they did not help. So I am explaining here my problem in hope that someone can help me.
    My company bought a HP Xeon X3450 @ 2.8Ghz. @Gb RAM DD3 1333 with Windows 7 64-Bits version Professional.
    We installed Adobe CS3 Suite on Windows 7 64-Bits version and the problems with fonts started.
    We used to work with XP Professional before this new machine arrived and never had system fonts propblems with Adobe CS3 Suite.
    Basically, what happens is:
    When I try to open PDF files with embed fonts (system fonts susch as ARIAL for example) the program returns an error saying that the fonts are not installed/available, but checking the C:\windows\fonts, they are there and working fine on Office or other common application such as notepad for example.
    I tried the workaround I found on these very forums of copying the fonts to the folder C:\Program Fils\Common Files\Adobe\Fonts and it still does not work.
    Formated the HD and then installed Windows 7 32 bits (x86) and still have the same problems. All updates were made and applied to Adobe and Windows respectively for both 64 and 32 versions and the error still happens.
    In resume, fonts are installed, they are system fonts but under Windows 7 64 or 32 bits versions they simply do not work when opening the PDF files with embed fonts.
    -The PDFs had no problems before while running windows XP Professional.
    -The PDFs open whithout any problems on machines with Windows Xp Professional.
    -This is happening specifically in Adobe Illustrator CS3 and CS5 and Adobe Acrobat Professional 8 and 9.
    Please, I urge for help since we don't know what to do anymore.
    Thank you all who took time to read this and forgive my terrible english, it is not my first language.
    Best regards,
    Message was edited by: Andre Gurtovoi - Reason: added information.

    Andre,
    What I believe you have is 2 different versions of Arial, you old machine probably contains the version you need.
    By old version, I mean one could by true type(XP), and another Opentype (WIn 7), and the error comes up. Even though they have they same name (Eg: Arial Bold).
    There are even old version of fonts that are both of the same font technology format and have different FOND ID  numbers(Eg: Frutiger was one that I often encountered, but you don't see this problem that much nowadays).

  • TableSorter errors when adding new data

    so here is the deal:
    I am using the TableSorter.java helper class with DefaultTableModel
    from: http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
    It works great when the data is static and I get it for the first time. however, occationally, when adding new data I get a NullPointerException error.
    in use:
    DefaultTableModel.addRow()
    DefaultTableModel.removeRow() and
    DefaultTableModel.insertRow() methods.
    Error:
    java.lang.ArrayIndexOutOfBoundsException: 5
         at com.shared.model.TableSorter.modelIndex(TableSorter.java:294)
         at com.shared.model.TableSorter.getValueAt(TableSorter.java:340)
         at javax.swing.JTable.getValueAt(Unknown Source)
         at javax.swing.JTable.prepareRenderer(Unknown Source)...
    code problem I:
        public Object getValueAt(int row, int column)
            return tableModel.getValueAt(modelIndex(row), column);
        }code problem II:
        public int modelIndex(int viewIndex)
                 return getViewToModel()[viewIndex].modelIndex;     
        }TableSroter class:
    package com.shared.model;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.util.List;
    import javax.swing.*;
    import javax.swing.event.TableModelEvent;
    import javax.swing.event.TableModelListener;
    import javax.swing.table.*;
    * TableSorter is a decorator for TableModels; adding sorting
    * functionality to a supplied TableModel. TableSorter does
    * not store or copy the data in its TableModel; instead it maintains
    * a map from the row indexes of the view to the row indexes of the
    * model. As requests are made of the sorter (like getValueAt(row, col))
    * they are passed to the underlying model after the row numbers
    * have been translated via the internal mapping array. This way,
    * the TableSorter appears to hold another copy of the table
    * with the rows in a different order.
    * <p/>
    * TableSorter registers itself as a listener to the underlying model,
    * just as the JTable itself would. Events recieved from the model
    * are examined, sometimes manipulated (typically widened), and then
    * passed on to the TableSorter's listeners (typically the JTable).
    * If a change to the model has invalidated the order of TableSorter's
    * rows, a note of this is made and the sorter will resort the
    * rows the next time a value is requested.
    * <p/>
    * When the tableHeader property is set, either by using the
    * setTableHeader() method or the two argument constructor, the
    * table header may be used as a complete UI for TableSorter.
    * The default renderer of the tableHeader is decorated with a renderer
    * that indicates the sorting status of each column. In addition,
    * a mouse listener is installed with the following behavior:
    * <ul>
    * <li>
    * Mouse-click: Clears the sorting status of all other columns
    * and advances the sorting status of that column through three
    * values: {NOT_SORTED, ASCENDING, DESCENDING} (then back to
    * NOT_SORTED again).
    * <li>
    * SHIFT-mouse-click: Clears the sorting status of all other columns
    * and cycles the sorting status of the column through the same
    * three values, in the opposite order: {NOT_SORTED, DESCENDING, ASCENDING}.
    * <li>
    * CONTROL-mouse-click and CONTROL-SHIFT-mouse-click: as above except
    * that the changes to the column do not cancel the statuses of columns
    * that are already sorting - giving a way to initiate a compound
    * sort.
    * </ul>
    * <p/>
    * This is a long overdue rewrite of a class of the same name that
    * first appeared in the swing table demos in 1997.
    * @author Philip Milne
    * @author Brendon McLean
    * @author Dan van Enckevort
    * @author Parwinder Sekhon
    * @version 2.0 02/27/04
    public class TableSorter extends AbstractTableModel
        protected TableModel tableModel;
        public static final int DESCENDING = -1;
        public static final int NOT_SORTED = 0;
        public static final int ASCENDING = 1;
        private static Directive EMPTY_DIRECTIVE = new Directive(-1, NOT_SORTED);
        public static final Comparator COMPARABLE_COMAPRATOR = new Comparator()
            public int compare(Object o1, Object o2)
                return ((Comparable) o1).compareTo(o2);
        public static final Comparator LEXICAL_COMPARATOR = new Comparator()
            public int compare(Object o1, Object o2)
                return o1.toString().compareTo(o2.toString());
        private Row[] viewToModel;
        private int[] modelToView;
        private JTableHeader tableHeader;
        private MouseListener mouseListener;
        private TableModelListener tableModelListener;
        private Map columnComparators = new HashMap();
        private List sortingColumns = new ArrayList();
        public TableSorter()
            this.mouseListener = new MouseHandler();
            this.tableModelListener = new TableModelHandler();
        public TableSorter(TableModel tableModel)
            this();
            setTableModel(tableModel);
        public TableSorter(TableModel tableModel, JTableHeader tableHeader)
            this();
            setTableHeader(tableHeader);
            setTableModel(tableModel);
        private void clearSortingState()
            viewToModel = null;
            modelToView = null;
        public TableModel getTableModel()
            return tableModel;
        public void setTableModel(TableModel tableModel)
            if (this.tableModel != null)
                this.tableModel.removeTableModelListener(tableModelListener);
            this.tableModel = tableModel;
            if (this.tableModel != null)
                this.tableModel.addTableModelListener(tableModelListener);
            clearSortingState();
            fireTableStructureChanged();
        public JTableHeader getTableHeader()
            return tableHeader;
        public void setTableHeader(JTableHeader tableHeader)
            if (this.tableHeader != null)
                this.tableHeader.removeMouseListener(mouseListener);
                TableCellRenderer defaultRenderer = this.tableHeader.getDefaultRenderer();
                if (defaultRenderer instanceof SortableHeaderRenderer)
                    this.tableHeader.setDefaultRenderer(((SortableHeaderRenderer) defaultRenderer).tableCellRenderer);
            this.tableHeader = tableHeader;
            if (this.tableHeader != null)
                this.tableHeader.addMouseListener(mouseListener);
                this.tableHeader.setDefaultRenderer
                        new SortableHeaderRenderer(this.tableHeader.getDefaultRenderer())
        public boolean isSorting()
            return sortingColumns.size() != 0;
        private Directive getDirective(int column)
            for (int i = 0; i < sortingColumns.size(); i++)
                Directive directive = (Directive)sortingColumns.get(i);
                if (directive.column == column)
                    return directive;
            return EMPTY_DIRECTIVE;
        public int getSortingStatus(int column)
            return getDirective(column).direction;
        private void sortingStatusChanged()
            clearSortingState();
            fireTableDataChanged();
            if (tableHeader != null)
                tableHeader.repaint();
        public void setSortingStatus(int column, int status)
            Directive directive = getDirective(column);
            if (directive != EMPTY_DIRECTIVE)
                sortingColumns.remove(directive);
            if (status != NOT_SORTED)
                sortingColumns.add(new Directive(column, status));
            sortingStatusChanged();
        protected Icon getHeaderRendererIcon(int column, int size)
            Directive directive = getDirective(column);
            if (directive == EMPTY_DIRECTIVE)
                return null;
            return new Arrow(directive.direction == DESCENDING, size, sortingColumns.indexOf(directive));
        private void cancelSorting()
            sortingColumns.clear();
            sortingStatusChanged();
        public void setColumnComparator(Class type, Comparator comparator)
            if (comparator == null)
                columnComparators.remove(type);
            else
                columnComparators.put(type, comparator);
        protected Comparator getComparator(int column)
            Class columnType = tableModel.getColumnClass(column);
            Comparator comparator = (Comparator) columnComparators.get(columnType);
            if (comparator != null)
                return comparator;
            if (Comparable.class.isAssignableFrom(columnType))
                return COMPARABLE_COMAPRATOR;
            return LEXICAL_COMPARATOR;
        private Row[] getViewToModel()
            if (viewToModel == null)
                int tableModelRowCount = tableModel.getRowCount();
                viewToModel = new Row[tableModelRowCount];
                for (int row = 0; row < tableModelRowCount; row++)
                    viewToModel[row] = new Row(row);
                if (isSorting())
                    Arrays.sort(viewToModel);
            return viewToModel;
        public int modelIndex(int viewIndex)
                 return getViewToModel()[viewIndex].modelIndex;     
        private int[] getModelToView()
            if (modelToView == null)
                int n = getViewToModel().length;
                modelToView = new int[n];
                for (int i = 0; i < n; i++)
                    modelToView[modelIndex(i)] = i;
            return modelToView;
        // TableModel interface methods
        public int getRowCount()
            return (tableModel == null) ? 0 : tableModel.getRowCount();
        public int getColumnCount()
            return (tableModel == null) ? 0 : tableModel.getColumnCount();
        public String getColumnName(int column)
            return tableModel.getColumnName(column);
        public Class getColumnClass(int column)
            return tableModel.getColumnClass(column);
        public boolean isCellEditable(int row, int column)
            return tableModel.isCellEditable(modelIndex(row), column);
        public Object getValueAt(int row, int column)
            return tableModel.getValueAt(modelIndex(row), column);
        public void setValueAt(Object aValue, int row, int column)
            tableModel.setValueAt(aValue, modelIndex(row), column);
        // Helper classes
        private class Row implements Comparable
            private int modelIndex;
            public Row(int index)
                this.modelIndex = index;
            public int compareTo(Object o)
                int row1 = modelIndex;
                int row2 = ((Row) o).modelIndex;
                for (Iterator it = sortingColumns.iterator(); it.hasNext();)
                    Directive directive = (Directive) it.next();
                    int column = directive.column;
                    Object o1 = tableModel.getValueAt(row1, column);
                    Object o2 = tableModel.getValueAt(row2, column);
                    int comparison = 0;
                    // Define null less than everything, except null.
                    if (o1 == null && o2 == null)
                        comparison = 0;
                    } else if (o1 == null)
                        comparison = -1;
                    } else if (o2 == null)
                        comparison = 1;
                    } else {
                        comparison = getComparator(column).compare(o1, o2);
                    if (comparison != 0)
                        return directive.direction == DESCENDING ? -comparison : comparison;
                return 0;
        private class TableModelHandler implements TableModelListener
            public void tableChanged(TableModelEvent e)
                // If we're not sorting by anything, just pass the event along.            
                if (!isSorting())
                    clearSortingState();
                    fireTableChanged(e);
                    return;
                // If the table structure has changed, cancel the sorting; the            
                // sorting columns may have been either moved or deleted from            
                // the model.
                if (e.getFirstRow() == TableModelEvent.HEADER_ROW)
                    cancelSorting();
                    fireTableChanged(e);
                    return;
                // We can map a cell event through to the view without widening            
                // when the following conditions apply:
                // a) all the changes are on one row (e.getFirstRow() == e.getLastRow()) and,
                // b) all the changes are in one column (column != TableModelEvent.ALL_COLUMNS) and,
                // c) we are not sorting on that column (getSortingStatus(column) == NOT_SORTED) and,
                // d) a reverse lookup will not trigger a sort (modelToView != null)
                // Note: INSERT and DELETE events fail this test as they have column == ALL_COLUMNS.
                // The last check, for (modelToView != null) is to see if modelToView
                // is already allocated. If we don't do this check; sorting can become
                // a performance bottleneck for applications where cells 
                // change rapidly in different parts of the table. If cells
                // change alternately in the sorting column and then outside of            
                // it this class can end up re-sorting on alternate cell updates -
                // which can be a performance problem for large tables. The last
                // clause avoids this problem.
                int column = e.getColumn();
                if (e.getFirstRow() == e.getLastRow()
                        && column != TableModelEvent.ALL_COLUMNS
                        && getSortingStatus(column) == NOT_SORTED
                        && modelToView != null)
                    int viewIndex = getModelToView()[e.getFirstRow()];
                    fireTableChanged(new TableModelEvent(TableSorter.this,
                                                         viewIndex, viewIndex,
                                                         column, e.getType()));
                    return;
                // Something has happened to the data that may have invalidated the row order.
                clearSortingState();
                fireTableDataChanged();
                return;
        private class MouseHandler extends MouseAdapter
            public void mouseClicked(MouseEvent e)
                JTableHeader h = (JTableHeader) e.getSource();
                TableColumnModel columnModel = h.getColumnModel();
                int viewColumn = columnModel.getColumnIndexAtX(e.getX());
                int column = columnModel.getColumn(viewColumn).getModelIndex();
                if (column != -1)
                    int status = getSortingStatus(column);
                    if (!e.isControlDown())
                        cancelSorting();
                    // Cycle the sorting states through {NOT_SORTED, ASCENDING, DESCENDING} or
                    // {NOT_SORTED, DESCENDING, ASCENDING} depending on whether shift is pressed.
                    status = status + (e.isShiftDown() ? -1 : 1);
                    status = (status + 4) % 3 - 1; // signed mod, returning {-1, 0, 1}
                    setSortingStatus(column, status);
        private static class Arrow implements Icon
            private boolean descending;
            private int size;
            private int priority;
            public Arrow(boolean descending, int size, int priority)
                this.descending = descending;
                this.size = size;
                this.priority = priority;
            public void paintIcon(Component c, Graphics g, int x, int y)
                Color color = c == null ? Color.GRAY : c.getBackground();            
                // In a compound sort, make each succesive triangle 20%
                // smaller than the previous one.
                int dx = (int)(size/2*Math.pow(0.8, priority));
                int dy = descending ? dx : -dx;
                // Align icon (roughly) with font baseline.
                y = y + 5*size/6 + (descending ? -dy : 0);
                int shift = descending ? 1 : -1;
                g.translate(x, y);
                // Right diagonal.
                g.setColor(color.darker());
                g.drawLine(dx / 2, dy, 0, 0);
                g.drawLine(dx / 2, dy + shift, 0, shift);
                // Left diagonal.
                g.setColor(color.brighter());
                g.drawLine(dx / 2, dy, dx, 0);
                g.drawLine(dx / 2, dy + shift, dx, shift);
                // Horizontal line.
                if (descending) {
                    g.setColor(color.darker().darker());
                } else {
                    g.setColor(color.brighter().brighter());
                g.drawLine(dx, 0, 0, 0);
                g.setColor(color);
                g.translate(-x, -y);
            public int getIconWidth()
                return size;
            public int getIconHeight()
                return size;
        private class SortableHeaderRenderer implements TableCellRenderer
            private TableCellRenderer tableCellRenderer;
            public SortableHeaderRenderer(TableCellRenderer tableCellRenderer)
                this.tableCellRenderer = tableCellRenderer;
            public Component getTableCellRendererComponent(JTable table,
                                                           Object value,
                                                           boolean isSelected,
                                                           boolean hasFocus,
                                                           int row,
                                                           int column)
                Component c = tableCellRenderer.getTableCellRendererComponent(table,
                        value, isSelected, hasFocus, row, column);
                if (c instanceof JLabel) {
                    JLabel l = (JLabel) c;
                    l.setHorizontalTextPosition(JLabel.LEFT);
                    int modelColumn = table.convertColumnIndexToModel(column);
                    l.setIcon(getHeaderRendererIcon(modelColumn, l.getFont().getSize()));
                return c;
        private static class Directive
            private int column;
            private int direction;
            public Directive(int column, int direction)
                this.column = column;
                this.direction = direction;
    }any input will be appreciated.
    thanks
    Peter

    The code you posted doesn't help us at all. Its just a duplicate of the code from the tutorial. The custom code is what you have written. For example do you update the TableModel from the Event Thread? Do you update the SortModel or the DefaultTableModel? If you actually provide your test code and somebody has already downloaded the sort classes, then maybe they will test your code against the classes. But I doubt if people will download the sort classes and create a test program just to see if they can duplicate your results (at least I know I'm not about to).

Maybe you are looking for

  • End Item Substitution & Substitute Components

    Dear Experts, Need your expert advise on Item Substitution Set & Substitute Component We have defined Item Relationship for an End Item and defined Planning Details mentioning partial fulfillment and applicable to all customers. We have also defined

  • Laptop drive as an external?

    While I'm waiting for my MBP to arrive I began thinking about what I can salvage from my pismo (MB fried). I spoke with the local Apple store, and their tech guys use a FW case that takes a hd from a laptop. They use it to transfer data from an old l

  • How can we call a external webservice from sandboxed webpart?

    Hi, I need to call an external webservice from sandboxed visual webpart in 2013. And that webpart would be used in office-365 site. Please let me whether it is possible or not. Thanks, Arindam

  • How do I turn off the ping after burning a cd?

    I would like to know how to turn off the ping sound after I burn a cd.  I have turned off all of the other pings, however I can not seem to figure out how to turn off that ping sound.  ANY help is greatly appreciated.  Cheers, CO

  • How can I order a spanish wireless keyboard?

    I want to order the wireless keyboard for my Ipad 2 but can't find the option to choose a spanish keyboard, does anybody knows the direct link or how can I do so? Thank you!