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

Similar Messages

  • How do I generate the pdf file using the name of a field.  How can I help

    how do I generate the pdf file using the name of a field.  How can I help

    Hi,
    here's a sample.
    LiveCycle Blog: Formulare in bestimmte Verzeichnisse speichern und nach Inhalt aus Formularfeld benennen //Save forms to…

  • How to generate a PDF output using batch file in 10G

    Hello,
    I am using .bat file to generate a report PDF output. I have done this many times in 6i but for 10G I am unable to do the same.
    Can someone please look at the syntax below and let me know where I am going wrong.
    I understand that reports are different for 6i and 10G specially .rep file but I am sure we should be able to generate a PDF file using 10G. Please let me know.
    Thanks
    IQ
    Contents of .bat file follow
    ECHO Opening parameter form. Please do not close this window.
    C:\
    FOR /F "tokens=1 " %%I IN ('time /t') DO (SET _TIME=%%I)
    FOR /F "tokens=2 " %%I IN ('date /t') DO (SET _DATE=%%I)
    SET EXP_DATE=%_DATE:~6,4%%_DATE:~0,2%%_DATE:~3,2%_%_TIME:~0,2%%_TIME:~3,2%
    SET FILENAME=SEND_EMAIL_%EXP_DATE%_%USERNAME%.PDF
    CD C:\Users\Documents
    RWCONVERTER REPORT=C:\Users\Documents\send_email.rep USERID=scott/tiger@ORCL1 ORIENTATION=LANDSCAPE DESFORMAT=PDF DESTYPE=FILE
    DESNAME=C:\Users\\%FILENAME% PRINTJOB =NO

    Rwconverter is not used to run reports:
    rwconverter (Reports Converter) enables you to convert one or more report definitions or PL/SQL libraries from one storage format to another.
    I think you mean rwrun:
    rwrun (Reports Runtime) runs a report by starting its own in-process server (not to be confused with the default in-process Reports Server), which runs in the same JVM as the rwrun process.
    This bat file has to run on the server. There is no Reports installation on the client anymore.
    If you want to run a report from a client, you can make a bat file that calls the report url
    See: http://download.oracle.com/docs/cd/E14571_01/bi.1111/b32121/pbr_cla002.htm#i634710

  • Generate a PDF file Using Adobe Document Service

    Hi All,
    How can I generate a PDF file using Adobe Document Service? The content of the PDF can be from any DataSource (Oracle/ BW/ R3 ).
    Can anyone get me some information.Points will be rewarded
    Thanks in advance
    Deepak Raj

    Hi Raj,
    You can look into this blog
    Creating your first application using Interactive forms
    If you get your answer ...set the thread as "answered"
    Regards,
    Sekhar

  • How to generate a pdf file

    hi i want to generate a pdf file using a java program, i have a string of xml format i want read the string and get each node of the string then
    pass it to generate pdf.how to do this, the problem is if i want to read
    xml then i must use org.w3c.dom.Element, but for pdf generation i must use com.lowagie.text.Element , so how to solve this.
    please help.
    rafel

    Well, obviously XML and PDF are two very different kinds of format, and it's up to you how one is going to be mapped into the other. There are at least two PDF APIs available free, but it's not a trivial format to manage.
    It's impossible to give you any more advice with the limited information you've supplied.

  • Does anyone know how i can view PDF files using Galaxy Note 2?

    Does anyone know how i can view PDF files using Galaxy Note 2?
    This is what i have been doing;
    I click on the file i wish to view (via a portal)
    this file goes to notification widget (i drag down screen)
    notification/message says download complete
    i click on notification/message
    nows it says complete action using (here i only have 2 icon options 1= DB Text Editor 2 = HTML Viewer)
    I have installed Adobe Reader.

    Can you confirm if the downloaded file is a pdf file, that is it ends with .pdf?

  • How to open a pdf file using OPEN DATASET

    Im trying to convert a pdf into binary format. So im trying to read the contents of the pdf into a XSTRING. Using the FM 'SCMS_XSTRING_TO_BINARY' i can convert the XSTRING to binary format.
    How to open a pdf file using OPEN DATASET and transfer its contents in a XSTRING variable.
    What i've tried is....
    DATA: f_name type string value 'C:\rep_output_pdf.pdf',
          x1 type xstring,
          LT_DATA TYPE STANDARD TABLE OF X255.
    OPEN DATASET f_name FOR input IN BINARY MODE.
    READ DATASET f_name INTO x1.
    CLOSE DATASET f_name.
    CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          BUFFER     = x1
        TABLES
          BINARY_TAB = LT_DATA.
    Im getting a short dump .
    Short text: The file is not open.
    Plz help me out.

    Hello Rajesh,
    You are trying to do use OPEN DATASET with a local file. NOT POSSIBLE
    You have to have the file in the app server to use OPEN DATASET.
    BR,
    Suhas

  • How do I download PDF files using Safari.  All I get is a black screen.

    How do I download PDF files using Safari.  All I get is a black screen.

    Back up all data.
    Quit Safari. In the Finder, select Go ▹ Go to Folder... from the menu bar, or press the key combination shift-command-G. Copy the line of text below into the box that opens, and press return:
    /Library/Internet Plug-ins
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then launch Safari and test.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • How to execute a exe file using javascript on app window.load.

    How to execute a exe file using javascript on app window.load.

    Hi sb00349044,
    As I have already mentioned in multiple replies to your previous questions, the SUMO forums focuses on providing help to end users with usage-questions and issues.
    For developer-related questions, please refer to one of the many resources readily available that I have linked to in the past:
    * [https://developer.mozilla.org/en-US/Firefox_OS MDN]
    * [http://stackoverflow.com/questions/tagged/firefox-os StackOverflow]
    * [https://lists.mozilla.org/listinfo Mozilla Mailing Lists]
    - Ralph

  • How to protect my PDF file using Adobe Acrobat Pro that i can trace user's IP adress?

    How to protect my PDF file using Adobe Acrobat Pro that i can trace user's IP adress?

    Used to be able. Considered a security bug. Fixed.

  • How to generate a pdf file from Excel

    Hi all,
    I've a Excel file i want to generate a pdf file by using java...can any one explain wht r the things r required. If ur answer is "iText" or "apache FOP" then wht r the things to be needed...I want to know the exact answer...step by step....plz help me out...
    Eagarly waiting for reply...
    regards
    [email protected]

    hi,
    I've a idea on jdk,,,i need to know who to use FOP packages?
    regards,
    [email protected]

  • How to open a PDF file using NWDS or VC

    Hi Frndz...
    As per my requirment i need to open a PDF file on browser which PDFs are reside on R/3 and in my case EP server is on UNIX usinig either NWDS or VC ....
    Thanks in Advance
    Regards
    Rajesh
    09903726944

    hi,
    can you put your question much more clearly? I couldnt get you properly.
    Check out the following links, they may be useful
    [How to Create a pdf form Using Web Dynpro - Java;
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/805709cb-ec97-2910-04b8-f3d6303d8d3b]
    [Diff - PDF view inside NWDS livecycle designer and when App. is run;
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/90e8e837-cc15-2a10-8db1-a87e2d29e9c9]
    Regards,
    Murthy.

  • How to upload a pdf file using webdynpro abap

    Hi Experts,
    I need to upload pdf files using webdynpro abap.my question is where to upload this files and how to upload this files, and how to display this pdf file.
    Please Provide Requried Information.
    Waiting for Reply.
    Thanks & Regards.
    Bhushan.

    Hi,
    There is a UI element with the type 'File Upload'.
    You can use that in your view.
    For further details and coding, please refer to
    [http://www.****************/Tutorials/WebDynproABAP/Upload/Page1.htm]
    Hope this helps you.
    Regards,
    Dolly

  • How to generate a PDF report using ADF RichTable?

    Hi,
    I am using JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660. I am displaying my data from db in a JSF Fragment(JSFF) using ADF RichTable component. Actually now I want to generate a PDF report using that data shown in the table on click of a Generate Button. Can anyone please provide me code or sample for that?
    Thanks,
    Vikas

    http://kohlivikram.blogspot.com/2009/04/generate-pdf-report-in-adf.html
    Thanks,
    Navaneeth

  • How to open the pdf file using LabVIEW program

    I want to open the pdf file using the system exe, but it is not happening . Can you help me?
    Solved!
    Go to Solution.

    In simpler version
    Mark the satisfied answer as accepted solution for your question,you mistakenly marked youself 
    Message Edited by Baji on 04-07-2009 05:03 PM
    Balaji PK (CLA)
    Ever tried. Ever failed. No matter. Try again. Fail again. Fail better
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
    Attachments:
    open pdf.JPG ‏25 KB

Maybe you are looking for