Problem creating  image from a data vector

Hello i have a problem in this aplication.
I get a image from a web cam. I want to put the original image in a file and the negative image in another file (in this example is not the negative image, is just a white image). The problem is when i use setData method. The image become black. If I use setFormat method the new image is the original image.
Here is the code with problems:
imageBuffer = frameGrabbingControl.grabFrame();
theData = new int[dataLength];
theData = (int[]) imageBuffer.getData();
for (int y = 0; y < videoHeight - imageScanSkip; y+=imageScanSkip) {
for (int x = 1; x < videoWidth - imageScanSkip; x+=imageScanSkip)
theData[y*videoWidth+x]=Integer.parseInt("FFFFFF",16);
Buffer b1=new Buffer(); //This is the new buffer in which i want to put the new pic
b1.setData(theData);
//here i create the 2 files frst from the original buffer and second from the new buffer b1
Image img = (new BufferToImage((VideoFormat)imageBuffer.getFormat()).createImage(imageBuffer));
Image img1 = (new BufferToImage((VideoFormat)b1.getFormat()).createImage(b1));
BufferedImage buffImg = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_RGB);
BufferedImage buffImg1 = new BufferedImage(320,240, BufferedImage.TYPE_INT_RGB);
Graphics2D g = buffImg.createGraphics();
Graphics2D g1 = buffImg1.createGraphics();
g.drawImage(img, null, null);
g1.drawImage(img1, null, null);
try{
ImageIO.write(buffImg, "jpg", new File("c:\\webcam.jpg"));
ImageIO.write(buffImg1, "jpg", new File("c:\\webcam1.jpg"));
catch (Exception e){}
the webcam1.jpg file is black(it should be white).
If i put "b1.setFormat(imageBuffer.getFormat());" the webcam1.jpg will be same the file as webcam.jpg

Hello i have a problem in this aplication.
I get a image from a web cam. I want to put the original image in a file and the negative image in another file (in this example is not the negative image, is just a white image). The problem is when i use setData method. The image become black. If I use setFormat method the new image is the original image.
Here is the code with problems:
imageBuffer = frameGrabbingControl.grabFrame();
theData = new int[dataLength];
theData = (int[]) imageBuffer.getData();
for (int y = 0; y < videoHeight - imageScanSkip; y+=imageScanSkip) {
for (int x = 1; x < videoWidth - imageScanSkip; x+=imageScanSkip)
theData[y*videoWidth+x]=Integer.parseInt("FFFFFF",16);
Buffer b1=new Buffer(); //This is the new buffer in which i want to put the new pic
b1.setData(theData);
//here i create the 2 files frst from the original buffer and second from the new buffer b1
Image img = (new BufferToImage((VideoFormat)imageBuffer.getFormat()).createImage(imageBuffer));
Image img1 = (new BufferToImage((VideoFormat)b1.getFormat()).createImage(b1));
BufferedImage buffImg = new BufferedImage(img.getWidth(null), img.getHeight(null), BufferedImage.TYPE_INT_RGB);
BufferedImage buffImg1 = new BufferedImage(320,240, BufferedImage.TYPE_INT_RGB);
Graphics2D g = buffImg.createGraphics();
Graphics2D g1 = buffImg1.createGraphics();
g.drawImage(img, null, null);
g1.drawImage(img1, null, null);
try{
ImageIO.write(buffImg, "jpg", new File("c:\\webcam.jpg"));
ImageIO.write(buffImg1, "jpg", new File("c:\\webcam1.jpg"));
catch (Exception e){}
the webcam1.jpg file is black(it should be white).
If i put "b1.setFormat(imageBuffer.getFormat());" the webcam1.jpg will be same the file as webcam.jpg

Similar Messages

  • Creating XML from raw data

    I am trying to create xml from raw data. It works well in the format builder but
    when I instanciate the MFLObject and run convert to xml, the output only contains
    wrappers for my first field described in the mfl. Are there any known issues
    using this progmattic conversion to XML.
    My mfl is the following:
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE MessageFormat SYSTEM 'mfl.dtd'>
    <!-- Enter description of the message format here. -->
    <MessageFormat name='BossRecord' version='2.01'>
    <FieldFormat name='Header' type='String' length='102' codepage='windows-1252'/>
    <StructFormat name='TransactionControlRecord' delim='999'>
    <FieldFormat name='TransactionTypeNumber' type='String' length='3' codepage='windows-1252'/>
    <FieldFormat name='TransactionData' type='String' codepage='windows-1252'>
    <LenField type='Numeric' length='4'/>
    </FieldFormat>
    </StructFormat>
    <StructFormat name='Generic' repeat='*'>
    <FieldFormat name='GenericTypeNumber' type='String' length='3' codepage='windows-1252'/>
    <FieldFormat name='GenericData' type='String' codepage='windows-1252'>
    <LenField type='Numeric' length='4'/>
    </FieldFormat>
    </StructFormat>
    <FieldFormat name='IgnoreTheRest' type='Filler' optional='y' length='1' repeat='*'>
    <!--
    This field is useful for testing partially constructed formats. Adding
    this field to the
    end of a format will cause any leftover bytes on the end of a binary file to be
    ignored when the data is converted to XML.
    -->
    </FieldFormat>
    </MessageFormat>
    Are there any issues with this that are easy to spot?
    Here is some sample output:
    _BossRecordDoc : <BossRecord>
    <Header>0601uskyloupw7vu0 IBVRTR 000006RSQ1010246000000000000020436000001-01-01-00.00.00.00000000000100170</Header>
    <Header>90100581D4EBC00AA3C18629ACA0004AC02E54BD289357023141961111F1111 99900207141D4EBC00AA3C18629ACA0004AC0</Header>
    <Header>2E54BD2893570231RIBBONS & BUTTONS 9 00000000000010.50CAD00000000000000.5</Header>
    <Header>0USD00000000000000.00USD00000000000077.00CAD 0CAUS00000000000000.91KGSA215D100CF3C18619AC</Header>
    <Header>90004AC02E54B 01 0001-0</Header>
    <Header>1-012003-04-072003-06-2501P/P03003984196000010100000000000000.00CAD 00
    FR00000000000000</Header>
    <Header>.0000000000000000000.00KGS00000000000000.00USD 00UPS T1</Header>
    <Header>0001-01-010001-01-01 0 000000000000000.00000000000000000.00USD0</Header>
    <Header>000000000000000.00 1 22222222222220 0100304061DC30500AA3C18629ACA</Header>
    <Header>0004AC02E54B1D4EBC00AA3C18629ACA0004AC02E54B</Header>
    <Header> 0010001-01-01 00000000000000.00USD00</Header>
    <Header>000000000000.00CAD00000000000010.00CAD</Header>
    <Header> 00000000000010.00CAD000000000000000010001-01-01K00404862A8D2C00AA3C186</Header>
    <Header>29ACA0004AC02E54B1DC30500AA3C18629ACA0004AC02E54B001 PURPLE RIBBONS</Header>
    It just keeps finding my first record instead of finding the remaing structure.
    I appreciate any help.
    Thanks,
    Michael

    Okay, I've got some coding off a site that looks like it will do what I want. It's quite a robust applications which will do more than I need but as long as it does at least what I want, i could care less. As it will extract files from the datastream for me, it is going to save them to disk.
    I believe I have to specify a directory to save it to. I believe this is the line I'm going to modify, so assuming that's the case, how do I specify a directory here:
    private File fileOutPutDirectory = null;
    Do I have to use absolute paths or can I use relative. Also, what directory construct is expected by java? Anyone with an example of what urls are supposed to look like in this case?
    Thanks,
    destin

  • Disk Utility fails to create image from double layer DVD

    I burned a double-layer DVD using iDVD. It plays fine on the mac and on set-top DVD players. However, when I try to create an image of the DVD using Disk Utility, I get "Can't create image 'name.cdr' (input/output error)". I've tried re-burning the original disk, but it gets the same error when trying to create an image. I've also tried each of the image types, all with the same result.

    I was having similar problems, although I don't think my issues was related to a double-layer DVD. What worked for me was selecting File > New > Disk Image from Folder. Select the DVD in the file open/save dialog with the same options you used before (e.g., DVD/CD master, etc).
    HTH
    - Dave

  • Disk Utility: Create Image from Volume Without Unused Space

    I'm trying to create a disk image from a mounted volume (flash memory in a video camera) but I don't want to write to it later, it's just for archiving. The problem is that the size of the original volume is 16 GB, so every image I create is huge, even if there is less than a 1 GB used.
    For example, I only have two short clips on there, about 1.1 GB used. When I create a new .dmg from the volume, the file is 5.28 GB and when I mount it it tells me the size of the volume is 15.3 GB. Clearly I understand why this is happening, it's creating a bit for bit copy of the original volume, but I don't need all that space since I'm never going to write to it.
    In disk utility it won't let me resize the image (it's grayed out). What do I do?

    I actually don't understand why this is happening (when I do this the created disk image only uses the space it needs) but you can get around it as follows. First create a blank read/write disk image to the size you want and then restore the memory card to that image.

  • Create image from byte[]array on server side

    Hello everyone..
    I'm developing an application which will take snapshots from a mobile device, and send it to my pc via bluetooth. I have my own midlet which uses the phone camera to take the snapshot, i want to transfer that snapshot to my pc.
    The snapshot is taken is stored in an array byte.
    The image can be created on the phone itself with no problem using : image.createImage(byte[])
    my problem is that when i send the array byte via bluetooth, and receive it on the server, i cannot create the image using the :image.createImage() code
    The connection is good since i have tested by writing the content of the array in a text file.
    Piece of midlet code:
                try{
                     stream = (StreamConnection)Connector.open(url);
                     OutputStream ggt = stream.openOutputStream();
                     ggt.write(str);
                     ggt.close();
                }catch(Exception e){
                     err1  = e.getMessage();
                }where str is my array byte containing the snapshot
    And on my server side:
    Thread th = new Thread(){
                   public void run(){
                        try{
                             while(true){
                                  byte[] b = new byte[in.read()];
                                  int x=0;
                                  System.out.println("reading");
                                  r = in.read(b,0,b.length);
                                  if (r!=0){
                                       System.out.println(r);     
                                       img = Image.createImage(b, 0, r);
                                                            //other codes
                                       i get this error message:
    Exception in thread "Thread-0" java.lang.UnsatisfiedLinkError: javax.microedition.lcdui.ImmutableImage.decodeImage([BII)V
         at javax.microedition.lcdui.ImmutableImage.decodeImage(Native Method)
         at javax.microedition.lcdui.ImmutableImage.<init>(Image.java:906)
         at javax.microedition.lcdui.Image.createImage(Image.java:367)
         at picserv2$1.run(picserv2.java:70)
    Please anyone can help me here? is this the way to create the image on the server side? thx a lot

    here is exactly how i did it :
    while(true){
                                  byte[] b = new byte[in.read()];
                                  System.out.println("reading");
                                  r = in.read(b, 0, b.length);
                                  if (r!=0){
                                       Toolkit toolkit = Toolkit.getDefaultToolkit();
                                       Image img = toolkit.createImage(b, 0, b.length);
                                       JLabel label = new JLabel(new ImageIcon(img) );
                                       BufferedImage bImage = new BufferedImage(img.getWidth(label),img.getHeight(label),BufferedImage.TYPE_INT_RGB);
                                       bImage.createGraphics().drawImage(img, 0,0,null);
                                       File xd = new File("D:/file.jpg");
                                       ImageIO.write(bImage, "jpg", xd);
                                       System.out.println("image sent");
                             }Edited by: jin_a on Mar 22, 2008 9:58 AM

  • Problem loading images from a return value of a function

    hello, I write because I uin problem in loading images from a return value of a function.
    I created a database with a field "image" of type string, where I put the physical address of the image. I have written like this: {__DIR__ }foto.jpg
    Place the code, so you understand better
    function imageViewImage(): javafx.scene.image.Image {
    connetti();
    lass.forName(driverName);
    con = DriverManager.getConnection(url,user,"");
    stmt = con.createStatement();
    var richiesta:String = "SELECT image from viaggio WHERE id_viaggio=7";
    rs1 = stmt.executeQuery(richiesta);
    var result :String;
    rs1.next();
    risultato = rs1.getString("image");
    JOptionPane.showMessageDialog(null, result);
    var imagez = Image{
    url:"{result}";
    return imagez;
    The image is in the source code package
    First I connect to the database, run the query and I take the contents of the image.
    Can anyone help me?
    Is right to put in the database {__DIR__} foto.jpg or do I put only foto.jpg?

    Hello unkus_nob,
    I would rather suggest you to save only filename of that image like "foto.jpg" in database. And just concat it with the String variable containing "{__DIR__}".
    Actually the javafx compiler converts the {__DIR__} to the existing class directory path something like : "jar:file:/..../".
    var currentDir ="{__DIR__}";
    risultato = "{currentDir}{rs1.getString("immagine"})"; 
    var image = Image{
        url:risultato
    return image;--NARAYAN G.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Problems creating invoice from order (DI API and SBO)

    Hello all!
    I´m getting various tax problems using the following code to automatically create invoices from existing orders.
    For Each currentKey In arrABEntrys
      objInv = objCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices)
      objAB.GetByKey(currentKey)
      objInv.CardCode = objAB.CardCode
      With objInv.Lines
        .BaseType = SAPbobsCOM.BoObjectTypes.oOrders
        .BaseEntry = currentKey
        .BaseLine = 0
        For i = 1 To objAB.Lines.Count - 1
          objInv.Lines.Add()
          BaseType = SAPbobsCOM.BoObjectTypes.oOrders
          .BaseEntry = currentKey
          .BaseLine = i
        Next
      End With
    If objInv.Add() = 0 Then
    Else
    End if
    The result of objInv.add() was first "5002 - 'Tax Definition (1)' (a very informative message to me).
    Then I checked my admin tax settings and put a check on "EU".
    The next time the result was "10 - Customer´s tax ID not defined OINV.LicTradNum"
    Actually, I don´t want to pre-set any fields in the invoice, because the order looks complete to me.
    By the way: The error occurs in SBO, too.
    Thanks for help in advance!
    Best regards
    Marian

    Hi Marian,
    Your Error "10 - Customer´s tax ID not defined OINV.LicTradNum" is not working (through DI and in SBO)
    occurs because your "Federal Tax ID" is not set up against the Business Partner. (This is on the main page of the Business Master Data Screen).
    Set this up and it will work in SBO and the DI API!

  • Displaying image from binary data using java

    hi there,
    i have created a swing applet displays me a url, what the url returns me is the image in binary format, and i want to show the complete image using that binary data
    so how do i do it.
    some thing like this :
    URL url = new URL("http://192.168.1.1:8086/file-storage/download/Zerg.jpg?version_id=35688");
    JEditorPane jep = new JEditorPane();
    jep.setPage(url);
    output is in binary on my applet window.

    Hey,
    This displays an image from a url, you could check if your url is and image or not using URL.getFileName() and see if it ends in gif jpeg etc. and then display it this way.
    hope it helps
    Nick Hanlon
    import java.awt.*;
    import java.awt.Image.*;
    import java.awt.Toolkit.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.text.html.*;
    public class SimpleApp extends JFrame {
    public static void main(String args[]) {
    SimpleApp aFrame = new SimpleApp();
    public SimpleApp() {
    super("Frame");
    /*JEditorPane jep = new JEditorPane();
    jep.*/
    try {
    HTMLEditorKit htmlKit = new HTMLEditorKit();
    JEditorPane ep = new JEditorPane();
    try {
    ep.setEditorKit(htmlKit);
    BufferedReader in = new BufferedReader(
    new StringReader(
    "<HTML><IMG SRC=\"http://developer.java.sun.com/images/chiclet.row.gif\"></HTML>"));
    htmlKit.read(in, ep.getDocument(),0);
    getContentPane().setLayout(new BorderLayout());
    setResizable(false);
    getContentPane().add(ep, "North");
    pack();
    show();
    } catch (javax.swing.text.BadLocationException e) {}
    } catch (IOException e) {}
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) { System.exit(0); }
    }

  • Problem showing images from UISlider

    I'm trying to get some images shown responsively as the user slides a slider,  If I set up my image on each call of SliderValueChanging (the selector for control event UIControlEventValueChanged), as below, then I get an error indicating there's an event after I've released it.
        UIImage *btnimg = [UIImage imageNamed:imagefile]; 
        [button setImage:btnimg forState:UIControlStateNormal];
        [btnimg release];
    The error occurs while the user is still using the slider and the message is:
    [UIImage _isResizable]: message sent to deallocated instance
    So I thought I'd store my images until the user has finished using the slider and release them then.  So I build them up in an array in SliderValueChanging as below:
        UIImage *btnimg = [UIImage imageNamed:imagefile]; 
        [button setImage:btnimg forState:UIControlStateNormal];
        // assign into our array for later release...
        if ( self.tmpimages == nil ) {
            //Initialize the array.
            self.tmpimages = [[NSMutableArray alloc] init];
        [self.tmpimages addObject:btnimg];
        [btnimg release];
    and then release them in SliderValueChanged (the selector for control event UIControlEventTouchUpInside)
        // tidy up our tmp images from sliding...
        if ( self.tmpimages != nil ) {
            [self.tmpimages removeAllObjects];
            [self.tmpimages release];
            self.tmpimages = nil;
    The sliding then works without any problems but I get an error when the sliding is finished indicating I'm trying to release an object which I've already released.
    [UIImage release]: message sent to deallocated instance
    The error is being generated from the releaseAllObjects call.
    What am I doing wrong?  Can I prevent either of these error scenarios so that I get my images to show responsively with the slider without any problems?
    Thanks!

    Under the Cocoa naming conventions objects returned by convenience methods like:
        UIImage *btnimg = [UIImage imageNamed:imagefile];
    are passed you autoreleased. You should not send a release to this object and the errors you're getting reflect this. If you add it to an array this will add to the retain count but you should not release it after adding it to the array - just add it.
    The magic words in Cocoa are alloc, copy and new. If you use these words when you create it then you own it. If not assume something else owns it and will do the right thing. If you release something you don't own (or have explicitly retained) you're stepping on the process and you'll get errors like the ones you're getting.
    HTH,
    =Tod

  • Problem creating Image for HP dc5100SFF

    We just installed Zenwork 6.5 and was in the process of creating image
    for HP dc5100 desktop systems, and we encounter some problems. The PC
    downloads Linux.3 and in the process of executing, cannot obtain IP
    address from the DHCP server. How can I get it to see the NIC driver
    which is Broadcom Netxtreme gigabit ethernet card.

    I am running SP1a
    > On Tue, 20 Sep 2005 18:39:34 GMT, [email protected] wrote:
    >
    > > How can I get it to see the NIC driver
    > > which is Broadcom Netxtreme gigabit ethernet card.
    >
    > are you running sp1b?
    > --
    > If you have already compiled drivers or have linux.2 please put them on
    > http://forge.novell.com/modules/xfmo...ect/?zfdimgdrv
    >
    > Marcus Breiden
    >
    > Please change -- to - to mail me.
    > The content of this mail is my private and personal opinion.
    > http://www.edu-magic.net

  • Create Tree from Preordered data

    Here is a quick summary of what I'm trying to do:
    I have a file with formatted like this
    Does it have legs?
    Dog
    Fish
    and the resulting tree for it should look like this
         Does it have legs?
         Dog        Fishand I'm trying to write a function that takes in a Scanner object that should already be tied to the data file and create a tree from this data that is already listed in Preorder fashion. I know tha recurison is probably the best way to go about this but everything that I have written hasn't worked. Also, I cant really figure out a way to use recursion when the function is taking in a Scanner I dont know how it would work.
    Any help would be greatly appreciated.
    Here is what I have now:
         public BinaryTree<String> readTree(Scanner data)
              BinaryTree<String> temp = new BinaryTree<String>();
              temp.attachLeft(data.next());
              temp.attachRight(data.next());
              return temp;
         }I know this function wont go through the whoel file, but I've tried many loops but I cant figure out how to get it to work so I'm convinced that I need to figure out how to make it recursive
    (yes I know that everything that can be done through recursion can be done with a loop)

    @OP:
    Here's how you could do it:
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.util.Scanner;
    import java.util.Stack;
    class Main {  
        public static void main(String[] args) throws FileNotFoundException {
            Scanner file = new Scanner(new File("data.txt"));
            BinTree tree = new BinTree(file);
            System.out.println(tree);
    class BinTree  {
        private BinNode root;
        public BinTree(Scanner file) {
            // create the root (first line in the file)
            root = new BinNode(file.nextLine());
            // create a stack
            Stack<BinNode> stack = new Stack<BinNode>();
            // push the root on the stack: we need it to add nodes to the left and right of it
            stack.push(root);
            // call the insert method to build the tree
            insert(stack, file);
        private void insert(Stack<BinNode> stack, Scanner file) {
            IF 'file' has no more lines left
                stop this method
            END IF
            BinNode 'next' <- the next line in 'file'
            IF the left node of the last node on the 'stack' equals null
                the left child of last node of the stack <- 'next' (but leave the stack in tact)
            ESLE
                the right child of last node of the stack <- 'next' (remove the last node of the stack)
            END IF
            IF 'next' is a question
                push 'next' on the stack
            END IF
            recursively call the insert(...) method here
    class BinNode {
        String data;
        BinNode right, left;
        public BinNode(String data) { this.data = data; }
        public String toString() { return this.data; }
    }

  • Create Report from HFM Data Grid

    Hi All,
    I need to create a report out of the Data Grid created in HFM and then publish that as a PDF. I found the Reporting feature in Manage Documents that uses system reports.
    And if I want a report from a data grid the Data Explorer option has to be selected for Report Type.But in this case I guess I need to create a Report Definition File and then upload it which seems to be complex.
    But am not able to figure out how I can directly take a HFM Data Grid as the source and generate a PDF Report out of it.
    Can this be done using BI Publisher? If so can anyone please provide the steps?
    Or, can it be done using the Financial Reporting Studio ?
    I sincerely appreciate any help!
    Thanks in advance!
    Chella

    select
    decode( abs((sysdate - end_time)-1), (sysdate - end_time)-1, 'TOO LONG AGO', '-' ) "Check" ,
    b.database_name , t.type_qualifier1 , b.host ,
    to_char(b.end_time, 'YYYYMMDD-HH24:MI:SS') , b.time_taken_display , b.output_bytes_display
    from mgmt$ha_backup b, mgmt$target t
    where b.target_guid = t.target_guid
    order by type_qualifier1, end_time;

  • Problem Displaying image from blob

    Hi all,
    I m using,
    Database : 10g Rel 2
    Frontend : DevSuite 10g
    OS : WinXp
    Browser : IE 6
    Problem : In my forms i m displaying images from blob column but some of the images are not displayed. I have tried with all image formats available in combination with all available display quality but no luck. What could be the reason for it and how do i solve it?
    Can anyone help me plz?
    Thnx in advance.
    Imtiaz

    Hello,
    It is very difficult for us to "guess" what images you can read and what others you cannot.
    Maybe you could provide more information on images that are not displayed ?
    What is their native format ?
    Francois

  • Having problems creating PDF from website with query-string URLs

    I have a website that I would like to create a PDF from. I am using the Create -> PDF from Web Page..., selecting the site's home page, and capturing 2 levels, with "stay on same path" and "stay on same server" checked in order to limit the scope of the crawl.
    Where the pages are at example.com/foo/ and example.com/foo/bar/, this works fine. However, where the pages are at example.com/foo/ and example.com/foo/?p=1, the page represented by the query string URL is not converted to the PDF.
    This is a problem, given that the site I want to archive as a PDF uses query strings for most of its pages.
    I have been able to individually convert a single query-string-based page into a PDF using this method, but doing this for every page on the site would be almost impossible given the sheer number of pages on the site.
    Is this a known issue? Is there a workaround other than separately capturing each page (which would be prohibitive effort)?
    I have tried this in both Acrobat Pro X and Acrobat Pro 9 for Mac, with the same results.

    Remember, Acrobat is a 32-bit application and as such cannot access all that 'extra' stuff.
    Be well...

  • Create Spool From OTF Data

    Hi all,
    Is there any way of creating a spool request or printing OTF data directly from an internal table.
    Scenario is that I have read a spool request with multiple pages into OTF format and now have an internal table with OTF data. I have then split the spool data at page level into another internal table.
    This table also contains OTF data . Is there anyway of printing this internal table directly to printer. If not is there any way of creating a spool request from this internal table?
    Regards,
    Preet

    May be i can help to some extent. I will just tell you how to convert a internal table into spool. I have done the coding
    REPORT  zpmm_pdf                                .
    TYPES : BEGIN OF itab,
            name(20) TYPE c,
            age TYPE i,
            *** TYPE c,
            END OF itab.
    DATA : gt_itab TYPE STANDARD TABLE OF itab,
           gw_itab TYPE itab.
    DATA : counter  TYPE i.
    ********************Data declaration for use in converting to pdf
    DATA : pripar LIKE pri_params.
    DATA : lw_space VALUE ''.
    DATA : itab_pdf LIKE tline OCCURS 0 WITH HEADER LINE.
    <b>*To get spool info</b>
    DATA : rqident LIKE tsp01-rqident ,
           rqcretime LIKE tsp01-rqcretime .
    <b>DATA: spool_id LIKE tsp01-rqident.</b>
    DATA : numbytes TYPE i,
           cancel.
    DATA : gv_filename LIKE rlgrap-filename VALUE 'C:\swet.pdf'.
    ********************END of Data declaration for use in converting to pdf
                           START-OF-SELECTION
    DO 20 TIMES.
      gw_itab-name = 'swetabh_shukla'.
      gw_itab-age = counter + 1.
      gw_itab-***  = 'M'.
      counter = counter + 1.
      APPEND gw_itab TO gt_itab.
      CLEAR : gw_itab.
    ENDDO.
    <b>* Gt_itab is the internal table that we will write to spool</b>
    *Start
    SET PARAMETER ID 'ZPDF' FIELD lw_space.
    <b>CALL FUNCTION 'GET_PRINT_PARAMETERS'</b>
      EXPORTING
        in_parameters          = pripar
        line_size              = 255
        layout                 = 'X_65_132'
        no_dialog              = 'X'
      IMPORTING
        out_parameters         = pripar
      EXCEPTIONS
        archive_info_not_found = 1
        invalid_print_params   = 2
        invalid_archive_params = 3
        OTHERS                 = 4.
    <b>*********To write data in spool</b>
    NEW-PAGE PRINT ON PARAMETERS pripar NO DIALOG .
    RESERVE 5 LINES.
    <b>*********From here data will be written in spool</b>
    WRITE : 'Name',
            'Age',
    LOOP AT gt_itab INTO gw_itab.
      WRITE : / gw_itab-name,
                gw_itab-age,
                gw_itab-***.
    ENDLOOP.
    <b>*****To switch off spool writing</b>
    NEW-PAGE PRINT OFF.
    ************End of spool writing
    <b>******To get the latest spool id of spool written by us</b>
    SELECT  rqident  rqcretime FROM tsp01
                 INTO (rqident,rqcretime)
                 WHERE rqowner = sy-uname
                 ORDER BY rqcretime DESCENDING.
      EXIT.
    <b>********  It will just read the latest spool id and exit</b>
    ENDSELECT.
    MOVE  rqident TO spool_id. <b>" We get the spool id here of the spool we wrote</b>
    <b>*Now  spool_id contains the spool id. We can convert this spool to pdf also as given *below</b>
    ****************************************************To convert spool to pdf
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
             src_spoolid = spool_id
          NO_DIALOG =
          DST_DEVICE =
          PDF_DESTINATION =
          IMPORTING
             pdf_bytecount = numbytes
          PDF_SPOOLID =
          LIST_PAGECOUNT =
          BTC_JOBNAME =
          BTC_JOBCOUNT =
           TABLES
             pdf = itab_pdf
          EXCEPTIONS
            err_no_abap_spooljob = 1
            err_no_spooljob = 2
            err_no_permission = 3
            err_conv_not_possible = 4
            err_bad_destdevice = 5
            user_cancelled = 6
            err_spoolerror = 7
            err_temseerror = 8
            err_btcjob_open_failed = 9
            err_btcjob_submit_failed = 10
            err_btcjob_close_failed = 11
            OTHERS = 12.
                           END-OF-SELECTION
    To download the pdf file as local file
    CALL FUNCTION 'DOWNLOAD'
               EXPORTING
                    bin_filesize     = numbytes
                    filename         = gv_filename
                    filetype         = 'BIN'
                    filetype_no_show = 'X'
               IMPORTING
                    act_filename     = gv_filename
                    filesize         = numbytes
                    cancel           = cancel
               TABLES
                    data_tab         = itab_pdf.
    <b> I think i gave a lot of extra code, but i just gave it for proper understanding.
    Only a few days ago i came across this concept. So had the ready made code.</b>
    <b>Please do reward point if helpful</b>
    Regards
    swetabh

Maybe you are looking for