How to make a "export selection to PNG"?

Hi everyone,
I really need to export selected objects (or groups) to PNG... and I need it to be fast, i cant waste time exporting to PDF and converting in photoshop.
I made a script to do this, but the quality is soo poor... so what i want to know is:
-Is it possible to do this with the InDesign SDK?
...and if it is possible, how hard it would be?
Im not really a developer, so i want to know what i have to do, so i can ask a friend to do.... or something like that!
Thanks!
(sorry about my bad english)

InDesign CS4,
step 1. Create SnapshotUtilsEx() with addTransparencyAlpha is kTrue.
SnapshotUtilsEx fSnapshotUtilsEx
          = new SnapshotUtilsEx(
                itemUIDRef,      xScale, yScale, desiredRes, minRes, bleed,
               SnapshotUtilsEx::kCsRGB,
               kTrue,  //bool8 addTransparencyAlpha ,
               kFalse);
step 2. Draw() with option ...
     fSnapshotUtilsEx.Draw( IShape::kPreviewMode|IShape::kPrinting );
step3. ExportImageToPNG
    IDFile fileSysFile = target png filename..
   InterfacePtr<IPMStream> pngStream(StreamUtil::CreateFileStreamWrite(fileSysFile, kOpenOut|kOpenTrunc));//, fileType, creator));
   if (pngStream == nil) {
   break;
   status = fSnapshotUtilsEx->ExportImageToPNG(pngStream);

Similar Messages

  • How to make a JPanel selectable

    When extending a JPanel and overriding the paintComponent() method the custom JPanel can not be selected so that it gets for example KeyEvents.
    But if I make the new Class extend a JButton it gets of course selected and able to receive for example KeyEvents.
    My question is therefore; what does the JButton implement that a JPanel doesn&#8217;t so that a JButton gets selectable? Or in other words; how to make a JPanel selectable?
    Aleksander.

    Try this extended code. Only the first panel added can get the Focus.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class Test extends JFrame
      public Test()
        setLocation(400,300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JPanel panel1 = new JPanel(new BorderLayout());
        JPanel panel2 = new JPanel(new BorderLayout());
        ImagePanel imgPanel = new ImagePanel();
        panel1.setFocusable(true);
        panel2.setFocusable(true);
        panel1.setPreferredSize(new Dimension(0, 50));
        panel2.setPreferredSize(new Dimension(0, 50));
        panel1.setBorder(BorderFactory.createLineBorder(Color.RED,     4));
        panel2.setBorder(BorderFactory.createLineBorder(Color.CYAN,    4));
        imgPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 4));
        panel1.add(new JLabel("Panel 1"), BorderLayout.CENTER);
        panel2.add(new JLabel("Panel 2"), BorderLayout.CENTER);
        getContentPane().add(panel1, BorderLayout.NORTH);
        getContentPane().add(panel2, BorderLayout.SOUTH);
        getContentPane().add(imgPanel, BorderLayout.CENTER);   
        pack();
        panel1.addKeyListener(new KeyAdapter(){
            public void keyPressed(KeyEvent ke){
                System.out.println("Panel1");}});
        panel2.addKeyListener(new KeyAdapter(){
            public void keyPressed(KeyEvent ke){
                System.out.println("Panel2");}});
      public static void main(String[] args){new Test().setVisible(true);}
    class ImagePanel extends JPanel
      Image img;
      public ImagePanel()
        setFocusable(true);
        setPreferredSize(new Dimension(400,300));
        try{img = javax.imageio.ImageIO.read(new java.net.URL(getClass().getResource("Test.gif"), "Test.gif"));}
        catch(Exception e){/*handled in paintComponent()*/}
        addKeyListener(new KeyAdapter(){
          public void keyPressed(KeyEvent ke){
            System.out.println("ImagePanel");}});
      public void paintComponent(Graphics g)
        if(img != null)
          g.drawImage(img, 0,0,this.getWidth(),this.getHeight(),this);
        else
          g.drawString("This space for rent",50,50);
    }

  • How to make users to select the date from calendar control my making the date field read only in date time control in external list in sharepoint 2010

    How to make users to select the date from calendar control only, by my making the date text field read only (don't want to let users type the date) in date time control in external list in sharepoint 2010. I am looking for a solution which can
    be done through sharepoint desginer / out of the box.
    thanks.

    Congratulate you got the solution by yourself. I am new to a
    WinForms calendar component, I feel so helpless on many problems even I'd read many tutorials. This question on the
    calendar date selection did me a great favor. Cheers.

  • How to make imovie export a sharper video

    how to make imovie export a sharper video

    set Firefox as your default browser ..start button >default programs >set your default programs >Firefox >set this program as default

  • How to make Label in selection screen?

    Hi friends.. can anybody explain how to make labels in selection screens and how to split the selection screen vertically? plz.. Thanks in advance

    Arun kumar,
    Check this program. you can put labels like this.
    REPORT  ZVENKAT_TEST1.
    SELECTION-SCREEN BEGIN OF BLOCK block.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(15) text1.
    SELECTION-SCREEN POSITION 17.
    PARAMETERS :p_pernr type pa0001-pernr.
    SELECTION-SCREEN POSITION 26.
    SELECTION-SCREEN COMMENT 27(30) text2.
    SELECTION-SCREEN end OF LINE.
    SELECTION-SCREEN end OF BLOCK block .
    at SELECTION-SCREEN OUTPUT.
      text1 = 'Personal number'.
      SELECT SINGLE ename FROM pa0001 INTO text2 WHERE pernr = p_pernr.
    Regards,
    Venkat.O

  • How to make a dynamic selection screen

    Hi
    I have been searching the SDN for long time, but couldn't find the answer, so therefor a new post.
    I have an internal table with following values:
    VBKD-BSARK_E
    TVKO-VKORG
    By these values I would like to make a new selection-screen whith following:
    Parameters: FIELD1 like VBKD-BSARK_E.
    Parameters: FIELD2 like TVKO-VKORG.
    Next time the internal table can contain
    MARA-MATNR
    TVKO-VKORG
    VBAK-BSTZD
    And the parameters should then be:
    Parameters: FIELD1 like MARA-MATNR.
    Parameters: FIELD2 like TVKO-VKORG.
    Parameters: FIELD3 like VBAK-BSTZD.
    How do I do that -any suggestions?

    Hi,
    This piece of code will design selection screen based on radio button selection:
        SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001 .
        SELECT-OPTIONS :  s_date  FOR  pnpbegps DEFAULT sy-datum  .   
        SELECTION-SCREEN: END OF BLOCK b1.
        SELECTION-SCREEN : BEGIN OF  BLOCK b2 WITH FRAME TITLE text-002.
        PARAMETERS:rb1 RADIOBUTTON GROUP rbf DEFAULT 'X'.
        PARAMETERS:rb2 RADIOBUTTON GROUP rbf .
        SELECTION-SCREEN: END OF BLOCK b2.
        SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003 .
        SELECTION-SCREEN BEGIN OF LINE.
        SELECTION-SCREEN COMMENT 1(25) text-006 FOR FIELD px_pdf.
        PARAMETERS:  px_pdf AS CHECKBOX USER-COMMAND xxx  .      
        SELECTION-SCREEN END OF LINE.
        SELECTION-SCREEN BEGIN OF LINE.
        SELECTION-SCREEN COMMENT 1(15) text-004 FOR FIELD rb_app.
        PARAMETERS:rb_app RADIOBUTTON GROUP gbf DEFAULT 'X' USER-COMMAND uc01.
        PARAMETERS: p_file(128) MODIF ID 001.           " application server
        SELECTION-SCREEN END OF LINE.
    Thanks,
    Krishna..

  • How to make a listbox selected item highlight color from code the same as if user click on item?

    Hi all,
    I have a listbox that gets filled with data when my program starts. I save the last selectedItem value so I set it when the program start again. But the color that the selected item has is not the same as if the user click on it (pictures below).
    The color when I set the selectedIndex=someItem is black on light grey (background)
    The color when the user clicks on the item is white on blue (background)
    Any way to make them both white on blue (background)?
    Thanks
    This is the user clicking on it:
    This is the code:

    I think the difference is focus.  When you use the mouse to select it also sets focus to the listbox so you would have to set focus to the listbox when you set the selected item.  How are you setting your selected item?  I think that by
    using a property to hold the selected item rather than setting the index that might also fix the problem.
    Lloyd Sheen

  • How to make Logic auto-select channel when external instrument is selected?

    I recently upgraded hardware and now have to upgrade the OS 9 software (MOTU FreeStyle) I've been using and join the 21st century. I asked a Guitar Center employee about what package to buy and stressed that I wanted the software to auto-select the midi channel since that was a major benefit (for me) in using FreeStyle. I was informed that all of the newer DAW software did this (which made sense to me, after all FreeStyle was already at least 10 years old, although no longer under development (hence OS 9.) Logic Express was specifically recommended.
    Sadly, I don't see this capability in Logic Express. I don't understand why, if I have 15 instruments set up, and I select a new one, I have to manually look at each of the other instruments (assuming I don't have their channels memorized) and see what channels have been used so that I don't accidentally reuse the same one for the new instrument. Doesn't the computer already know what channels are unused??
    In FreeStyle could have 25 instruments set up for a 16 channel keyboard, and as long as there was never more than 16 voices playing at any particular time, the software just managed the channels for me. I don't know what happens if you go over 16 for a 16 channel instrument, I don't think I ever did (I never had voices cut out anyway.)
    Not to berate Logic Express, there's lots of cool stuff in it that I'm looking forward to exploring, and it sounds like you have to jump through hoops even to get MOTU's Digital Performer to emulate the same behavior and I suspect it's as much of a hassle to set it up as to just do it on the fly (from previous experience of "what a salesman says" vs. "what is real.") I'm just trying to figure out how to make the computer do the computer work so that I can do the music work.
    I have lots of partial (and even some complete!) projects to port over and not nearly as much spare time as I'd like to spend playing. I'd rather spend my meager spare time composing, not fighting with the technology.
    Any ideas?
    Thanks,
    -David

    Hi bunker,
    I can't test it at the moment but I think that can be achieved by slightly changing the code like so:
    *<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>*
    *<script type="text/javascript">*
    *$(document).ready(function(){*
    *$("td.GFPFilter span input").focus(function(event){*
    this.select();
    this.value = '';
    *</script>*
    Also, if you found my posts helpful or correct could you apply those labels to the relevant posts?
    Cheers,
    J
    Edited by: J Kremer on 20-Apr-2011 19:23
    Edited by: J Kremer on 20-Apr-2011 19:30

  • How to Make field for selection in the datasource.

    Hi All,
    I want to enable one field in the DataSource for selection. I am not getting where can we make that enable.
    I know we have one check box in transfer structure for make file for selection. But I am getting that is grayout , not able to check that ?
    Please let me know where can we change the setting to make it enable.
    regards
    Ashutosh D

    Look at Roberto's reply in the below post :
    Re: Hos to make a filed to be required field when creating datasource
    What is ur datasource ..?
    Have u tried RSA6 Change Mode for that datasource - Flag Selection?
    Message was edited by:
            Jr Roberto

  • How to make  struts html:select tag readOnly....!!!!

    Hi All,
    In my below code I want to make <html:select> as readonly like I did for <html:text>
    I don't want to make it disabled as it is graying out that field.
    My requirement is that it should be visible and also it shouldn't be editable.
    I am using Struts...!!!
    <html:text property="paramName" size="20" maxlength="50" readonly="true"/>                                
    <html:select property="paramTypeId" disabled="true"> // I dont want to use this--- disabled="true"
         <html:options collection="queryReturnType" property="value" labelProperty="label"/>
    </html:select>Thanks in advance....!!

    Can some one tell me in the below code
    *1. what is test="${controlEnabled}"....wha is this controlEnabled variable*
    *2. do I need to create an attribute for paramTypeId_Label in my form bean ??*
    I just wanna to make my <html:select> readonly..pls see my first post in this thread....!!
    <c:choose>
         <c:when test="${controlEnabled}">
           <html:select property="paramTypeId" >
                <html:options collection="queryReturnType" property="value" labelProperty="label"/>
           </html:select>
         </c:when>
         <c:otherwise
           <html:text property="paramTypeId_Label" value="${queryReturnType[paramTypeId].label}" readonly="true"/>
           <html:hidden property="paramTypeId"/>
         </c:otherwise>
    </c:choose>--Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to make excel export in jsp

    Hi All,
    I have a jsp page to display a table. I want to add a "excel download" button
    in this page, once user click this button, it will invoke the microsoft excel
    and all table content will appear in the excel spreadsheet.
    I tried to set the content: <%@ page contentType="application/vnd.ms-excel"%>
    the rest code as following. However, it won't work for me. Does anyone has any
    experience in doing this?
    <%@ page contentType="application/vnd.ms-excel"%>
    <%@ taglib uri="netui-tags-databinding.tld" prefix="netui-data"%>
    <%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
    <%@ taglib uri="netui-tags-template.tld" prefix="netui-template"%>
    <netui:html>
    <head>
    <title>
    Web Application Page
    </title>
    </head>
    <body>
    <table border="1">
    <tr style="background-color:#3366ff;font-family:arial;">
    <td>Structure</td>
    <td>Compound</td>
    <% // Get the Items from the request stream
                   Vector mr_names = (Vector) request.getAttribute("method_result_names");
    for (int f=0;f<mr_names.size();f++) {
    out.println("<td>" + mr_names.get(f) + "</td> ");
    Vector mrs = (Vector) request.getAttribute("method_results");
    for (int g=0; g<mrs.size(); g++)
    out.println("</tr><tr>");
    Vector row1 = (Vector)mrs.get(g);
    for (int f=0;f<mr_names.size()+1;f++) {
    String s = (String)row1.get(f);
    if (f==0) {
    %>
    <td><embed src="structure.jsp?Sample_code=<%=s%>" width="120" height="100"></embed></td>
    <%
    out.println("<td>" + s + "</td> ");
    out.println("</tr>");
    %>
    </table>
    </body>
    </netui:html>
    Thanks!
    Zhenhao

    I am trying to do the same thing. I also cant get it to work. I am
    thinking it may have something to do with the concept of ScopedResponse, but
    I am not sure. There is very little documentation and more importantly
    examples of how to make sense of the getOuterResponse() method. Dev2Dev and
    Google are of no help.
    Anyone care to explain this to us?
    Michael.
    "Zhenhao Qi" <[email protected]> wrote in message
    news:3fd4f634$[email protected]..
    >
    Hi All,
    I have a jsp page to display a table. I want to add a "excel download"button
    in this page, once user click this button, it will invoke the microsoftexcel
    and all table content will appear in the excel spreadsheet.
    I tried to set the content: <%@ pagecontentType="application/vnd.ms-excel"%>
    the rest code as following. However, it won't work for me. Does anyone hasany
    experience in doing this?
    <%@ page contentType="application/vnd.ms-excel"%>
    <%@ taglib uri="netui-tags-databinding.tld" prefix="netui-data"%>
    <%@ taglib uri="netui-tags-html.tld" prefix="netui"%>
    <%@ taglib uri="netui-tags-template.tld" prefix="netui-template"%>
    <netui:html>
    <head>
    <title>
    Web Application Page
    </title>
    </head>
    <body>
    <table border="1">
    <tr style="background-color:#3366ff;font-family:arial;">
    <td>Structure</td>
    <td>Compound</td>
    <% // Get the Items from the request stream
    Vector mr_names = (Vector) request.getAttribute("method_result_names");
    for (int f=0;f<mr_names.size();f++) {
    out.println("<td>" + mr_names.get(f) + "</td> ");
    Vector mrs = (Vector)request.getAttribute("method_results");
    for (int g=0; g<mrs.size(); g++)
    out.println("</tr><tr>");
    Vector row1 = (Vector)mrs.get(g);
    for (int f=0;f<mr_names.size()+1;f++) {
    String s = (String)row1.get(f);
    if (f==0) {
    %>
    <td><embed src="structure.jsp?Sample_code=<%=s%>"width="120" height="100"></embed></td>
    >
    <%
    out.println("<td>" + s + "</td> ");
    out.println("</tr>");
    %>
    </table>
    </body>
    </netui:html>
    Thanks!
    Zhenhao

  • How to make column as selection-button in REUSE_ALV_GRID_DISPLAY

    Hi
    I want to make my first column of display as selction-colums. I mean i want to set the selection mode. user can select one column or more that column at a time.
    Aditya

    This sample works, perhaps u can understand your problem:
    TYPE-POOLS: SLIS.
    DATA: I_CALLBACK_PROGRAM TYPE SY-REPID.
    DATA: T_T001 TYPE TABLE OF T001.
    START-OF-SELECTION.
    SELECT * FROM T001 INTO TABLE T_T001.
    I_CALLBACK_PROGRAM = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
      EXPORTING
        I_CALLBACK_PROGRAM                = I_CALLBACK_PROGRAM
        I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
        I_CALLBACK_USER_COMMAND           = 'USER_COMMAND '
        I_STRUCTURE_NAME                  = 'T001'
      TABLES
        T_OUTTAB                          = T_T001.
    FORM USER_COMMAND  USING R_UCOMM LIKE SY-UCOMM
                             RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN 'MY_CODE'. MESSAGE I208(00) WITH R_UCOMM.
        WHEN OTHERS.
      ENDCASE.
    ENDFORM.                    "user_command
    FORM SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'MY_ALV' EXCLUDING RT_EXTAB .
    ENDFORM.                    "SET_PF_STATUS
    The status gui MY_ALV is copied for the standar gui STANDARD_FULLSCREEN of program SAPLKKBL
    Max

  • How to make applescript to select every 3rd file to move to new folder?

    I have an interesting 'problem' I think.
    As a result of a time-lapse experminent, I have a folder which holds several thousands of pictures from a fixed point, made over several days & nights.
    But there is one issue: the camera made 3 different exposures every 5 seconds.
    This resulted in every 3rd picture 'belonging' to each other. So these have to be selected for going in a seperate folder. Menaing: pictures 1 and 4 and 7 and 10 .... they must go in one folder. 2 and 4 and 8 and 11.. in the second folder. Finally 3 and 5 and 9 and 12 in a third folder.
    How to do this with software (to avoid injury) because of the thousands of pics.
    Is this do-able with applescript? How?
    Tnx

    Hello
    You may try something like the following script.
    Main part is written in shell script for performance sake. AppleScript is only used for user interface.
    Please see comments in script for its usage and behaviour.
    And please test the script first with small subset of your images.
    (Since the script will scan the source folder tree for image files, it is good idea not to create destination folders in source folder tree.)
    Minimally tested with OSX10.2 at hand but NO WARRANTIES of any kind.
    Make sure you have full backup of your images before applying this script.
    Hope this may help,
    H
    image file (jpg) sorter
    v0.2
    Script will let you choose two folders, i.e. -
    a) source folder where images reside (directory tree under the chosen folder is scanned),
    b) destination parent folder where three subfolders will be made (named '0', '1', '2').
    The file number i is obtained by removing extension and non-digts from file name.
    The file with number i (0-based) in source tree will be moved to (i mod 3)'th subfolder in destination.
    e.g.,
    IMG_1440.JPG -> '0' (i = 1440, i mod 3 = 0)
    IMG_1441.JPG -> '1' (i = 1441, i mod 3 = 1)
    IMG_1442.JPG -> '2' (i = 1442, i mod 3 = 2)
    IMG_1443.JPG -> '0' ...
    IMG_9997.JPG -> '1'
    IMG_9998.JPG -> '2'
    IMG_9999.JPG -> '0'
    IMG_0001.JPG -> '1'
    IMG_0002.JPG -> '2'
    IMG_0003.JPG -> '0'
    image file name convention : ZZZZ_9999.jpg
    set src to choose folder with prompt "Choose source folder."
    set src_ to (src's POSIX path's text 1 thru -2)'s quoted form
    set dst to choose folder with prompt "Choose destination parent folder."
    set dst_ to (dst's POSIX path's text 1 thru -2)'s quoted form
    set sh to "
    # source directory
    srcdir=" & src_ & ";
    # destination directories
    dstdir=" & dst_ & ";
    dest=("$dstdir"/{0,1,2});
    # make destinations
    mkdir -p "${dest[@]}";
    # let k = number of destination directories
    k=${#dest[@]};
    # sort files to destinations such that -
    # 1) number i is obtained by removing extension and non-digits from file name; and
    # 2) file with number i is stored in (i % k)'th destination, where i is zero-based.
    # e.g. Given xxxx_9999.jpg, k = 3;
    # i = 9999 and the file is sorted to destination 0 (= 9999 mod 3)
    find "$srcdir" -type f -iname '*.jpg' -print0 | while read -d $'\0' f;
    do
    leaf=${f##*/}; # get file name
    stem=${leaf%.*}; # remove extension
    i=${stem//[^0-9]/}; # remove non-digts from file name
    let i=0+10#$i; # to interpret, e.g., 010 as 10, otherwise 010 is treated as octal.
    # echo "$i $f ${dest[i % k]}"; # for testing
    mv "$f" "${dest[i % k]}"; # move file
    done
    do shell script sh
    display dialog "Done" with icon 1 giving up after 20

  • Can any tell me how to make Collage from selected images

    Hi
    I need to make a Collage of selected Images. Can anybody tell me how to proceed or point me a finger in the right direction. If there is an example then it would be great.
    Thanks in advance
    praveena

    One way you can do this is to override Panel, and set up clips, like this (mind you this is a very crude example. If you used this method, you'd want to set up loops and calculations to set the Polygon dimensions:
      private class MySubPanel  extends Panel {
        private Image[] images;
        private MySubPanel(Image[] _images) {
          images  = _images;
        public void paint(Graphics g) {
    // Just for a test, let's just assume only two Images are past in.
          int[]   xPnts = new int[] { 0,30,50,70,80, 95,75,60,45,30,15, 0},
                  yPnts = new int[] {20,35,15,35,20,110,75,95,70,85,55,30};
          Polygon p     = new Polygon(xPnts, yPnts, 12);
          g.setColor(new Color(50,150,20));
          g.setClip(p);
          g.drawImage(images[0], 0, 0, this);
          xPnts = new int[] { 0,15,30,45,60,75, 95, 80, 70, 50, 30,  0};
          yPnts = new int[] {30,55,85,70,95,75,220,130,145,135,155,130};
          p     = new Polygon(xPnts, yPnts, 12);
          g.setColor(new Color(50,150,20));
          g.setClip(p);
          g.drawImage(images[1], 0, 0, this);

  • ICal: how to make my print selections become the default

    how do I make my chosen printer selections become the default? Also, is there a way to assign selections to a named type of "file", i.e, "My Calendars", "My To Dos", etc.?

    If you leave a CD, DVD, or some disc with data, in the internal drive, it should then use the external drive for burning. If you use good blank discs, such as Verbatim, there should be no reason to reduce the burning speed.

Maybe you are looking for