How to display pdf using codename one technology ? Need Help. Thanks in Advanced.

212 views
Skip to first unread message

Mohammed Ghouse

unread,
Jul 30, 2013, 12:33:09 AM7/30/13
to codenameone...@googlegroups.com
TEAM

How to display pdf using codename one technology ?  Need  Help.  Thanks in Advanced.


Best Regards:
MGouse

Shai Almog

unread,
Jul 30, 2013, 2:00:14 AM7/30/13
to codenameone...@googlegroups.com
Some people were successful in just showing it in the WebBrowser component and it "just worked". For Android/iOS this should work just fine although in other platforms this probably won't work.

Mohammed Ghouse

unread,
Jul 30, 2013, 2:03:16 AM7/30/13
to codenameone...@googlegroups.com
That is what exactly i am looking into. As per U some people done it. I need help from that people to startup coding for showing pdf. i need procedure or sample code for help.

Shai Almog

unread,
Jul 30, 2013, 2:22:48 PM7/30/13
to codenameone...@googlegroups.com
Just show a PDF instead of an HTML file, not much to do there. I'm saying some people because I haven't tried it myself or verified it personally.

Mohammed Ghouse

unread,
Aug 12, 2013, 1:23:11 PM8/12/13
to codenameone...@googlegroups.com
I can able to display PDF & download [ with the help of GoogleDerive URL ] using below mentioned Code:

        WebBrowser webDisplayPDF = new WebBrowser();
        String strTargetURL = "http://research.microsoft.com/pubs/79655/gazelle.pdf";
        String strGoogleDriveURL = "https://docs.google.com/gview?embedded=true&url=";
        webDisplayPDF.setURL(strGoogleDriveURL + strTargetURL);

But, if i don't use GoogleDriveURL, then PDF is not coming .... ! why ? i don't know.

        WebBrowser webDisplayPDF = new WebBrowser();
        String strTargetURL = "http://research.microsoft.com/pubs/79655/gazelle.pdf";
        webDisplayPDF.setURL(strTargetURL);

This Code is not working. But i don't want to use GoogleDriveURL because may be GoogleDrive storing that PDF [ this can be the security problem ]

Need to solve this problem. Need HELP please .... !

Shai Almog

unread,
Aug 13, 2013, 1:09:10 AM8/13/13
to codenameone...@googlegroups.com
We don't place any limitations or restrictions on PDF viewing. This is entirely up to the native browser of the device. Which device are you experiencing this on?

Steve Hannah

unread,
Aug 13, 2013, 1:24:39 AM8/13/13
to codenameone...@googlegroups.com
Here's a theory:

You are trying this on a device that doesn't support a native browser component so it is using the HTMLComponent to render it.  When viewing a PDF through Google Drive it is actually just displaying HTML - not a PDF - this is why it would work in HTMLComponent while a normal PDF would not.

If you are using the simulator, make sure you have a JRE with JavaFX (e.g. Oracle's Java 7 - not OpenJDK); Otherwise it won't have a native browser component.

Steve


On Monday, August 12, 2013, Shai Almog wrote:
We don't place any limitations or restrictions on PDF viewing. This is entirely up to the native browser of the device. Which device are you experiencing this on?

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
Visit this group at http://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/3776acf9-62ab-4c88-b743-332d2964af51%40googlegroups.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

mathura...@gmail.com

unread,
Apr 15, 2015, 1:24:33 AM4/15/15
to codenameone...@googlegroups.com
Dear all

What is my question for this is can we use external tools  / JAR files to view the pdf or to read the pdf and show the contents of the pdf in a new form as text or other????

Shai Almog

unread,
Apr 15, 2015, 1:46:18 AM4/15/15
to codenameone...@googlegroups.com, mathura...@gmail.com
Please write your own question rather than commenting on a discussion from 2013. In that question please try to be more clear about what you are trying to accomplish.
Reply all
Reply to author
Forward
0 new messages