Images present in datagridview not exporting to file only text contents are generating into PDF file..

Hi Everyone,
   I have created simple Desktop app in that I trying to generate PDF file from Datagridview...when I click on ExportPDf button Pdf file is generation successfully but the issue is in that pdf whatever the images has present in datagridview that images
are not generation into PDF only the text contents are Present in PDF file.
  Does any one can tell me how to generate the PDF file along with images.
Here is my code:
  private void btnexportPDF_Click(object sender, EventArgs e)
            int ApplicationNameSize = 15;
            int datesize = 12;
            Document document = null;
            try
                SaveFileDialog savefiledg = new SaveFileDialog();
                savefiledg.Filter = "All Files | *.* ";
                if (savefiledg.ShowDialog() == DialogResult.OK)
                    string path = savefiledg.FileName;
                    document = new Document(PageSize.A4, 3, 3, 10, 5);
                    PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(path + ".pdf", FileMode.Create));
                    document.Open();
                    // Creates a phrase to hold the application name at the left hand side of the header.
                    Phrase phApplicationName = new Phrase("Sri Lakshmi Finance,Hosur-560068", FontFactory.GetFont("Arial", ApplicationNameSize, iTextSharp.text.Font.NORMAL));
                    // Creates a phrase to show the current date at the right hand side of the header.
                    Phrase phDate = new Phrase(DateTime.Now.ToLongDateString(), FontFactory.GetFont("Arial", datesize, iTextSharp.text.Font.NORMAL));
                    document.Add(phApplicationName);
                    document.Add(phDate);
                    iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance("D:\\logo.JPG");
                    document.Add(img);
                    iTextSharp.text.Font font5= iTextSharp.text.FontFactory.GetFont(FontFactory.TIMES_ROMAN, 5);
                    iTextSharp.text.Font font6 = iTextSharp.text.FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 6);
                    //float[] columnDefinitionSize = { 2.5f, 7.0f,6.6f, 8.6f, 6.6f, 5.0f, 4.5f, 7.0f, 6.3f, 7.0f, 3.5f, 6.0f, };
                    PdfPTable table = null;
                    table = new PdfPTable(dataGridView1.Columns.Count);
                    table.WidthPercentage = 100;
                    PdfPCell cell = null;
                    foreach (DataGridViewColumn c in dataGridView1.Columns)
                        cell = new PdfPCell(new Phrase(new Chunk(c.HeaderText,font6)));
                        cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
                        cell.VerticalAlignment = PdfPCell.ALIGN_CENTER;
                        cell.BackgroundColor = new iTextSharp.text.BaseColor(240, 240, 240);
                        table.AddCell(cell);
                    if (dataGridView1.Rows.Count > 0)
                        for (int i = 0; i < dataGridView1.Rows.Count; i++)
                            PdfPCell[] objcell = new PdfPCell[dataGridView1.Columns.Count];
                            for (int j = 0; j < dataGridView1.Columns.Count - 0; j++)
                                cell = new PdfPCell(new Phrase(dataGridView1.Rows[i].Cells[j].Value.ToString(), font5));
                                cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT;
                                cell.VerticalAlignment = PdfPCell.ALIGN_LEFT;
                                cell.Padding = PdfPCell.ALIGN_LEFT;
                                objcell[j] = cell;
                            PdfPRow newrow = new PdfPRow(objcell);
                            table.Rows.Add(newrow);
                    document.Add(table);
                    MessageBox.Show("PDF Generated Successfully");
                    document.Close();
                else
                    //Error 
            catch (FileLoadException fle)
                MessageBox.Show(fle.Message);
                MessageBox.Show("Error in PDF Generation", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Runtime Gridview content:
Generated PDF File:
Thanks & Regards RAJENDRAN M

Hi Everyone,
   I have created simple Desktop app in that I trying to generate PDF file from Datagridview...when I click on ExportPDf button Pdf file is generation successfully but the issue is in that pdf whatever the images has present in datagridview that images
are not generation into PDF only the text contents are Present in PDF file.
  Does any one can tell me how to generate the PDF file along with images.
Here is my code:
  private void btnexportPDF_Click(object sender, EventArgs e)
            int ApplicationNameSize = 15;
            int datesize = 12;
            Document document = null;
            try
                SaveFileDialog savefiledg = new SaveFileDialog();
                savefiledg.Filter = "All Files | *.* ";
                if (savefiledg.ShowDialog() == DialogResult.OK)
                    string path = savefiledg.FileName;
                    document = new Document(PageSize.A4, 3, 3, 10, 5);
                    PdfWriter writer = PdfWriter.GetInstance(document, new FileStream(path + ".pdf", FileMode.Create));
                    document.Open();
                    // Creates a phrase to hold the application name at the left hand side of the header.
                    Phrase phApplicationName = new Phrase("Sri Lakshmi Finance,Hosur-560068", FontFactory.GetFont("Arial", ApplicationNameSize, iTextSharp.text.Font.NORMAL));
                    // Creates a phrase to show the current date at the right hand side of the header.
                    Phrase phDate = new Phrase(DateTime.Now.ToLongDateString(), FontFactory.GetFont("Arial", datesize, iTextSharp.text.Font.NORMAL));
                    document.Add(phApplicationName);
                    document.Add(phDate);
                    iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance("D:\\logo.JPG");
                    document.Add(img);
                    iTextSharp.text.Font font5= iTextSharp.text.FontFactory.GetFont(FontFactory.TIMES_ROMAN, 5);
                    iTextSharp.text.Font font6 = iTextSharp.text.FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 6);
                    //float[] columnDefinitionSize = { 2.5f, 7.0f,6.6f, 8.6f, 6.6f, 5.0f, 4.5f, 7.0f, 6.3f, 7.0f, 3.5f, 6.0f, };
                    PdfPTable table = null;
                    table = new PdfPTable(dataGridView1.Columns.Count);
                    table.WidthPercentage = 100;
                    PdfPCell cell = null;
                    foreach (DataGridViewColumn c in dataGridView1.Columns)
                        cell = new PdfPCell(new Phrase(new Chunk(c.HeaderText,font6)));
                        cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
                        cell.VerticalAlignment = PdfPCell.ALIGN_CENTER;
                        cell.BackgroundColor = new iTextSharp.text.BaseColor(240, 240, 240);
                        table.AddCell(cell);
                    if (dataGridView1.Rows.Count > 0)
                        for (int i = 0; i < dataGridView1.Rows.Count; i++)
                            PdfPCell[] objcell = new PdfPCell[dataGridView1.Columns.Count];
                            for (int j = 0; j < dataGridView1.Columns.Count - 0; j++)
                                cell = new PdfPCell(new Phrase(dataGridView1.Rows[i].Cells[j].Value.ToString(), font5));
                                cell.HorizontalAlignment = PdfPCell.ALIGN_LEFT;
                                cell.VerticalAlignment = PdfPCell.ALIGN_LEFT;
                                cell.Padding = PdfPCell.ALIGN_LEFT;
                                objcell[j] = cell;
                            PdfPRow newrow = new PdfPRow(objcell);
                            table.Rows.Add(newrow);
                    document.Add(table);
                    MessageBox.Show("PDF Generated Successfully");
                    document.Close();
                else
                    //Error 
            catch (FileLoadException fle)
                MessageBox.Show(fle.Message);
                MessageBox.Show("Error in PDF Generation", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
Runtime Gridview content:
Generated PDF File:
Thanks & Regards RAJENDRAN M
Hello,
Since this issue is mainly related to iTextSharp which belongs to third-party, I would recommend you consider posting this issue on its support website to get help.
Maybe the following forum will help.
http://support.itextpdf.com/forum/26
Regards,
Carl
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • No Microsoft files listed in the settings "convert into PDF files"

    Hi, I wanted to convert different Microsoft Office files, but it doesn't work. There are no Microsoft files listed in the settings "convert into PDF files". I had the trial version of Adobe Acrobat Pro XI installed on a MAC in Windows that runs trough Parallels. Hope somebody can help. Thx

    Hi Rahul,
    many thanks for your suggestion.
    Yes, Parallels is a virtual machine on the top of MAC and I can see all files in the Windows Explorer. Also the ones I created on the MAC top with the Microsoft Office Software Word or Excel for MAC as well the ones I created earlier on a Windows PC.
    Unfortunately there is no possibility to convert files into PDF format with a click on the right mouse. And Adobe also doesn't open Word documents because it doesn't support this format.
    But nonetheless it wouldn't be a solution that I prefer to convert in adavance every single file in a PDF format. I need to create a PDF package from different formats.
    I assume this issue has to do something with MAC or Parallels, because this function of the Adobe Versions Acrobat 8 Pro and XI Pro work well on a Windows PC. I just don't understand why there are no Microsoft Office file formats listed in the Adobe settings. This settings also can't be changed. I tried to find out but couldn't find any hint for this problem thus I'm a bit at a loss... Maybe you have another idea?
    Regards
    Ly

  • How can i convert image into pdf  file

    Hi Friends,
    I want to convert image file(i.e. jpeg,bmp,gif) into pdf file using java apis OR is there any tool which can convert it & which we can integrate into our java application
    Thanks in adva.

    Is there any solution to this case.....?

  • Error when I generate a PDF file - Can't parse printer configuration file:

    I am receiving an error "Can't parse printer configuration file: uiprint.txt" when try generate to PDF file. The pdf file is generated but when I open the forms builder and show canvas the same error appears and canvas is shown in crazy way.
    My uiprint.txt has the follows:
    REPORTS_TMP=/tmp; export REPORTS_TMP
    REPORTS_NO_DUMMY_PRINTER=TRUE; export REPORTS_NO_DUMMY_PRINTER
    REPORTS_TAGLIB_URI=/WEB-INF/lib/reports_tld.jar; export REPORTS_TAGLIB_URI
    REPORTS_CLASSPATH=$ORACLE_HOME/reports/jlib/rwbuilder.jar:$ORACLE_HOME/reports/jlib/rwrun.jar:$ORACLE_HOME/jlib/zrclient.jar:$ORACLE_HOME/j2ee/home/oc4j.jar:$ORACLE_HOME/j2ee/home/lib/ojsp.jar;export REPORTS_CLASSPATH
    TK60_UNKNOWN=$ORACLE_HOME/guicommon6/tk60/admin; export TK60_UNKNOWN
    TK60_PPD=$ORACLE_HOME/guicommon6/tk60/admin/PPD; export TK60_PPD
    LE_HOME/guicommon9/tk90/admin/AFM; export TK90_AFM
    TK60_FONTALIAS=$ORACLE_HOME/guicommon6/tk60/admin; export TK60_FONTALIAS
    PRINTER=testprint;export PRINTER
    TK2_PRINTER=echo;export TK2_PRINTER
    testprint:PostScript:2:HP printer:hp4si3_1.ppd
    Can someone help me?
    Thanks

    Hello,
    The file uiprint.txt must not contain environment variables definitions.
    Put the lines :
    REPORTS_TMP=/tmp; export REPORTS_TMP
    REPORTS_NO_DUMMY_PRINTER=TRUE; export REPORTS_NO_DUMMY_PRINTER
    REPORTS_TAGLIB_URI=/WEB-INF/lib/reports_tld.jar; export REPORTS_TAGLIB_URI
    REPORTS_CLASSPATH=$ORACLE_HOME/reports/jlib/rwbuilder.jar:$ORACLE_HOME/reports/jlib/rwrun.jar:$ORACLE_HOME/jlib/zrclient.jar:$ORACLE_HOME/j2ee/home/oc4j.jar:$ORACLE_HOME/j2ee/home/lib/ojsp.jar;export REPORTS_CLASSPATH
    TK60_UNKNOWN=$ORACLE_HOME/guicommon6/tk60/admin; export TK60_UNKNOWN
    TK60_PPD=$ORACLE_HOME/guicommon6/tk60/admin/PPD; export TK60_PPD
    LE_HOME/guicommon9/tk90/admin/AFM; export TK90_AFM
    TK60_FONTALIAS=$ORACLE_HOME/guicommon6/tk60/admin; export TK60_FONTALIAS
    PRINTER=testprint;export PRINTER
    TK2_PRINTER=echo;export TK2_PRINTER
    in the file reports.sh
    and keep only
    testprint:PostScript:2:HP printer:hp4si3_1.ppd
    in uiprint.txt
    Regards

  • Images into pdf files

    Hi all, sometimes iBooks doesn't show images into pdf file.
    I usually read the same newspaper every day (pdf) and sometimes I experience that trouble.
    Also into iTunes thumbnail you couldn't see the images, but by double-clicking on the file, when you open Acrobat, the file is ok with all images.
    It seems the problem is not the original pdf file but some things/settings/encoding.. into iTunes/iBooks.
    Any help?
    Thank you.

    More information is needed.  How are the PDF's being created?  Where are they coming from?  All the same source or any PDF you open on the iPad?  Have you tried a reset?  Restore?  Other?

  • Photoshop Images on illustrator, generate bad PDF Files !

    When editing a native illustrator file with linked photoshop images on layers (cuts, paths with transparent background), and we generate a PDF file from any version since 1.4, we got the cuts and /or paths marked with a stroke (line) between the image and the background.
    If we generate this file on version 1.3, this problem do not appear, but the images comes completely fragmented, what makes later edition impossible.

    1. Please show screenshots
    2. A PDF is not meant for editing. If you want to edit later, either save an AI file on top or save the PDF with Illustrator editing capabilities (this embeds a fully editable AI file into the PDF, of course making it bigger)
    3. in a PDF 1.3 every transparency gets flattened which causes the fragmentation. Read the documentation on transparency, you'll need it anyway. There's a PDF called
    A Designer's Guide to Transparency for Print Output
    4. PDF version has to be selected carefully depending only on the demands of whoever prints or displays it afterwards.

  • Parameter issue - report not generating any pdf files

    Hi All,
    I'm trying to run a report which generates pdf files. Is there any limitation on the parameter string size? For one of the parameter values - '11F EA Accept nonhonor ASnSOMnSON_20091201090150846' the report is not generating any pdf files. I assumed the reason is of the keyword 'AS' in it and created another parameter value - '11F EA Accept nonhonor AnS-SOM-SON_20091202074331997', but it is also not generating any pdf files. I get this message from Adobe Reader " There was an error opening this document. This file cannot be opened because it has no pages. " The report is working normally when i hardcode the same parameter values into the logic. Any suggestions on this?
    Thanks.
    Edited by: user1049091 on Dec 2, 2009 9:17 AM
    Edited by: user1049091 on Dec 2, 2009 12:37 PM

    Tim,
    That report is working normally for all the parameter values, except this one. It is not working only if i pass the value - ''11F EA Accept nonhonor ASnSOMnSON_20091201090150846' as a parameter. It is generating the pdf files when i hardcode the same value into sql query logic in the data template, instead of passing it as a parameter. Please advise.
    Thanks.

  • After the last update that was pushed out by Adobe, my Acrobat 9 Pro will not generate a PDF file fr

    After the last update that was pushed out by Adobe, my Acrobat 9 Pro will not generate a PDF file from; [right click], Combine files into one PDF multiple files chosen in the explorer.  A message pops up asking if I want to run repair.  Answering in the afirmative results in another message stating files are missing.  And we are back at square one.

    What is the exact error?  Else you could always reinstall your software.

  • Can I insert the image file into PDF file  in Adobe X Standard ?

    can I insert the image file into PDF file in Adobe X Standard ?

    http://matt.coneybeare.me/how-to-make-an-html-signature-in-apple-mail-for-maveri cks-os-x-10-dot-9/

  • Reader v11 will not open in Windows Explorer (or browser) when clicking a PDF file; just a flash on the screen.

    Reader v11 will not open in Windows Explorer (or browser) when clicking a PDF file; just a flash on the screen. I can open Reader from Programs then open the file. I'm using a laptop upgraded to Windows 7

    I do no understand "flash on the screen"; could it be http://support.microsoft.com/kb/2716529 ?

  • Urgent: Error while uploading into pdf file

    Hi ,
    I got a requirement that converting smartform into pdf file and sending into application server, And uploading the that pdf file into presentation server once a day am geting error when uploading into pdf format from application server .
    Error : There was an  error while tryinging to parse an image.
    Please help me out its urgent.
    Thanks in advance
    Regards
    krishna
    Edited by: krishna rao on Feb 13, 2008 12:05 PM

    U can use this code
    Reward if useful
    REPORT  ZMN_PDF_UPLOAD.
    data: begin of itab occurs 0,
    field(256),
    end of itab.
    data: dsn(100) value '\usr\sap\DEV\DVEBMGS00\work\testpdf',
    length like sy-tabix,
    lengthn like sy-tabix.
    call function 'GUI_UPLOAD'
    exporting
    filename = 'c:\temp\test.pdf'
    filetype = 'BIN'
    importing
    filelength = length
    tables
    data_tab = itab.
    open dataset dsn for output in binary mode.
    loop at itab.
    transfer itab-field to dsn.
    endloop.
    close dataset dsn.
    clear itab.
    refresh itab.
    *To crosscheck if it went well
    open dataset dsn for input in binary mode.
    do.
    read dataset dsn into itab-field.
    if sy-subrc = 0.
    append itab.
    else.
    exit.
    endif.
    enddo.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = 'c:\temp\testn.pdf'
    filetype = 'BIN'
    bin_filesize = length
    importing
    filelength = lengthn
    tables
    data_tab = itab.
    *Or
    *Use the TCode
    *CG3Z or CG3Y
    *for downloading to Application Server.

  • How to preserve a background color, when generating a PDF file

    I am trying to create a PDF file from some application. Please note that the picture in this application has the black background. So I invoke a Print command and set a printer as "Adobe PDF". As a result, I have generated
     a brilliant PDF file of my picture, but on the WHITE background. When selecting the Adobe PDF printer, I have looked through all its settings ( in the Adobe PDF settings, I have found several tabs: General, Images, Fonts, Color, Advanced, PDF/X), none of them generated the original background color. 
    So how can a generate a PDF file, having the original background color (black, in my case) ?
    Oleg

    Now I feel that the background definition in the Adobe PDF printer and the background definition in the application the Adobe PDF printer is invoked from -- two different things. So I guess how can I define the black background in the Adobe PDF printer? I cannot find such settings.

  • In smartform word document convert into pdf file

    Hi Experts,
    I have issue on smartform, i have done two page smartform in preview its coming properly but
    when i give to print its not coming properly...output is not coming properly...so please sugest me
    even how to covert smartform word document into PDF file...im waiting for your replay. Thanks in
    Advance....
    Regards
    Ashwini

    Hi,
       I hope its printer problem check with u r basis, and for Smartform to PDF bewlow is my coding in which by using OTF data from Smartform it ill veiw in PDF.
    *& Report  ZSAP_PDF_VIEWER_DEMO_2
    REPORT  ZSAP_PDF_VIEWER.
    DATA: LT_PDF TYPE TABLE OF TLINE,
          LS_PDF LIKE LINE OF LT_PDF,
          LV_URL TYPE CHAR255,
          PDF_FSIZE TYPE  I,
          LV_CONTENT  TYPE XSTRING,
          LT_DATA TYPE STANDARD TABLE OF X255.
    DATA : L_JOB_OUTPUT_INFO TYPE SSFCRESCL.
    DATA : LS_CONTROL_PARAM  TYPE SSFCTRLOP.
    DATA : G_HTML_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
           G_HTML_CONTROL   TYPE REF TO CL_GUI_HTML_VIEWER.
    DATA: LO_DIALOG_CONTAINER TYPE REF TO CL_GUI_DIALOGBOX_CONTAINER.
    DATA: LO_DOCKING_CONTAINER TYPE REF TO CL_GUI_DOCKING_CONTAINER.
    DATA : P_VBELN TYPE  VBELN_VL.
    FIELD-SYMBOLS <FS_X> TYPE X.
    INITIALIZATION.
    LS_CONTROL_PARAM-GETOTF = 'X'.
    LS_CONTROL_PARAM-NO_DIALOG = 'X'.
    START-OF-SELECTION.
      CALL FUNCTION '/1BCDWB/SF00000034'
    EXPORTING
       ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
         CONTROL_PARAMETERS         = LS_CONTROL_PARAM
         P_VBELN                    = P_VBELN
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
    IMPORTING
         DOCUMENT_OUTPUT_INFO  = L_DOCUMENT_OUTPUT_INFO
           JOB_OUTPUT_INFO       = L_JOB_OUTPUT_INFO
         JOB_OUTPUT_OPTIONS    = L_JOB_ OUTPUT_OPTIONS
    EXCEPTIONS
        FORMATTING_ERROR           = 1
        INTERNAL_ERROR             = 2
        SEND_ERROR                 = 3
        USER_CANCELED              = 4
        OTHERS                     = 5
      IF SY-SUBRC  <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          FORMAT                = 'PDF'
        IMPORTING
          BIN_FILESIZE          = PDF_FSIZE
        TABLES
          OTF                   = L_JOB_OUTPUT_INFO-OTFDATA
          LINES                 = LT_PDF
        EXCEPTIONS
          ERR_MAX_LINEWIDTH     = 1
          ERR_FORMAT            = 2
          ERR_CONV_NOT_POSSIBLE = 3
          OTHERS                = 4.
    convert pdf to xstring string
      LOOP AT LT_PDF INTO LS_PDF.
        ASSIGN LS_PDF TO <FS_X> CASTING.
        CONCATENATE LV_CONTENT <FS_X> INTO LV_CONTENT IN BYTE MODE.
      ENDLOOP.
       CALL SCREEN 100.
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS '100'.
    **CREATE OBJECT LO_DOCKING_CONTAINER
    EXPORTING
       REPID     = SY-REPID
       DYNNR     = '100'"SY-DYNNR
       SIDE      = LO_DOCKING_CONTAINER->DOCK_AT_LEFT
       EXTENSION = 1200.
    CREATE OBJECT g_html_container
       EXPORTING
         container_name = 'HTML'.
    *CREATE OBJECT G_HTML_CONTROL
    EXPORTING
       PARENT = LO_DOCKING_CONTAINER.
      CREATE OBJECT G_HTML_CONTAINER
          EXPORTING
            CONTAINER_NAME = 'HTML'.
        CREATE OBJECT G_HTML_CONTROL
          EXPORTING
            PARENT = G_HTML_CONTAINER.
    Convert xstring to binary table to pass to the LOAD_DATA method
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          BUFFER     = LV_CONTENT
        TABLES
          BINARY_TAB = LT_DATA.
    *application/
    Load the HTML
      CALL METHOD G_HTML_CONTROL->LOAD_DATA(
         EXPORTING
           TYPE         =  'application'
           SUBTYPE      =   'pdf' "
         IMPORTING
           ASSIGNED_URL         = LV_URL
         CHANGING
           DATA_TABLE           = LT_DATA
         EXCEPTIONS
           DP_INVALID_PARAMETER = 1
           DP_ERROR_GENERAL     = 2
           CNTL_ERROR           = 3
           OTHERS               = 4 ).
    CALL METHOD G_HTML_CONTROL->show_url
         EXPORTING  url        = lv_url
                   in_place    = 'X'
         EXCEPTIONS cntl_error = 1.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    MODULE user_command_0100 INPUT.
      DATA ok_code LIKE sy-ucomm.
      MOVE sy-ucomm TO ok_code.
      CASE ok_code.
        WHEN 'BACK' OR 'EXIT'.
         CALL METHOD LO_DOCKING_CONTAINER->free.
          CALL METHOD g_html_control->free.
          LEAVE TO SCREEN 0.
        WHEN OTHERS.
      ENDCASE.
    ENDMODULE.                 " USE

  • How to generate a pdf file using javascript?

    I would like to generate a pdf file having images in it using javascript. I tried jsPDF but getting some exceptions like
    Uncaught ReferenceError: pageWidth is not defined,
    fail to load pdf document
    Could anyone show me some pointers?
    Thank You
    Rahul

    Here is my code
    var myImg=new Image();
      myImg.src=arrData['employee'][1]['Image'];
      myImg.crossOrigin ="Anonymous";
       var imgData = this.getBase64Image(myImg);
       var doc = new jsPDF();
       doc.setFontSize(40);
       doc.text(35, 25, "Test Image");
       doc.addImage(myImg, 'JPEG', 15, 40, 180, 160);
       doc.save("sample1.pdf");
    I'm receiving the following error at 'addImage' function.
    Uncaught Error: getJpegSize could not find the size of the image
    Could you please help in pointing out where am I going wrong.
    Thank You

  • Issue with generating large pdf file using cfdocument tags in CF9

    We are in the process of upgrading our code to use cf9 and the cfdocument tag (from the old cfx_pdf tags).  We have successfully gotten one piece of our code to work but the file size of the pdf that we are generating now is huge in comparison to what it was using the CFX_PDF tags. (I.E.  with the new code the file is 885 KB in comparison to the old code generating only a 11KB file). We are not embedding fonts so the Fontembed = "no" didn't work for us.  We do have all of our images as .jpgs but unfortunately due to the volume of images that we have we can not switch all these files into another format.  Is there is way to shrink or optimize the pdf file size that we are generating? 
    Thanks so much for your help.
    Claudia

    We are in the process of upgrading our code to use cf9 and the cfdocument tag (from the old cfx_pdf tags).  We have successfully gotten one piece of our code to work but the file size of the pdf that we are generating now is huge in comparison to what it was using the CFX_PDF tags. (I.E.  with the new code the file is 885 KB in comparison to the old code generating only a 11KB file). We are not embedding fonts so the Fontembed = "no" didn't work for us.  We do have all of our images as .jpgs but unfortunately due to the volume of images that we have we can not switch all these files into another format.  Is there is way to shrink or optimize the pdf file size that we are generating? 
    Thanks so much for your help.
    Claudia

Maybe you are looking for

  • Fields missing in Characteristic Relationship

    Hi Experts, I want to derive Currency Key from Company code using Characteristic Relationship. I am using 'With Derivation' and master data attributes. But in the source fields I see only two fields Cost Center and Controlling Area. Not sure why I am

  • Why are my web browsers constantly freezing?

    Whether it is safari, firefox, camino or seamonkey, after leaving the browser idle for like 5 minutes while reading a page then clicking a link to visit another page the browser freezes and I must use force quit and restart. This is so frustrating, a

  • 4710 in one-armed mode

    is it possible to preserve the clients originating IP address somewhere while using the 4710 in one armed mode?  I have a situation where the client source ip is needed, and I am deciding between one-armed mode and inline.  I'd like to use one-armed,

  • Splitting event in imovie

    I am attempting to split an event as per the imovie help menu. However, when I choose file after clicking on the clip that I want to become the first clip of the new event, "Split event before selected clip" is greyed out - not an option. What am I m

  • BIA 7.9.5.1 - Export tool

    Hi, When I want to do an export from DAC nothing is happening, no window is opening. I stopped and restarted the server and the problem is the same. The import is working fine. Do you have any suggestions? Any help would be appreciated. Thanks, I.