How to open a pdf file in cocos2d-x project? - android

I want to open a file (pdf file to be exact) in iOS and Android through my cocos2d-x Project. It is to serve as help in my game. Is there any way to do so. I found we can open it in webview but how to do so on both iOS and android?
Thanks in advance

Short answer is no! Cocos2d family does not natively support PDF.
However, you can use open source C++ libraries to convert PDF to PNG on fly and load it as a texture in cocos2d-x.
My recommendation is to covert pdf to png on a PC and load png in cocos2d-x.

I did it using WebView both on Android and iOS. Also #kasra was correct and his way too works as a solution.

Related

How i can convert video file to .mov file extension

I am developing an android application. In that I have to convert all the video files to '.mov' file extension. Is it possible to do in android app? Please guide me.
You can do this with the FFMPEG
here are some useful references:
http://writingminds.github.io/ffmpeg-android-java/
https://www.labnol.org/internet/useful-ffmpeg-commands/28490/
http://www.hongkiat.com/blog/ffmpeg-guide/
https://github.com/WritingMinds/ffmpeg-android-java
There is no native way to do this that I found but there are many conversion websites like this

Open PDF with PhoneGap in Android

I need open an PDF file that is in an url. I need open it with an PDF Viewer...
It is possible?
Thanks for all.
Best regards.
I suggest using the ChildBrowser plugin and using Google's viewer to actualy open the PDF (since Android doesn't have a default PDF viewer).
So you can open a PDF like this:
onclick='window.plugins.childBrowser.showWebPage(encodeURI("http://docs.google.com/viewer?url=' + pdfLink + '"));
in android (i don't know phonegap) there are many pdf viewer libraries.
like Android-Pdf-Viewer-Library
or Droid Text
or MuPDF
or APV Pdf Viewer
if you develope your application commercial and don't want to pay any money
use first one.

android- Converting pdf into images

I'm developing an Android application which involves reading pdf files.
Initially on syncing with the server a set of pdf files will be saved into the device's SD card.
Now, I have a requirement to convert this pdf file into images. Because on doing that the speed of loading the pages are faster..
can anyone help me with this and if possible give me links to some sample code..
I got this idea from here https://stackoverflow.com/a/4779852/1105585 ....
but i don't know how this works... help plz..
I'm currently working on an app that loads files and adds effects to the images. One of the formats suppose to support is PDF. I used leadtools libs for the rasterrizing pdfs (converting pdf into raster images) and some image effects.
Hope this helps.
PDF isn't made up of images, they're vectors,.
couple open-source java PDF to Image converters
http://www.jpedal.org/
http://code.google.com/p/pdfonejava/
On desktop I've used iText java library for that kind of task. Not sure if its Android compatible but worth of giving a shot as its easy to implement.

How to integrate Batik with Android to open & display SVG files?

I see on this post that Batik is the way to open SVG files with Android: svg files rendering in android
But in the post is not explained how to integrate batik with android.
Someone know how to use Batik with Android to open and show SVG files?
thanks

How to code for reading pdf file in android?

How to code for reading a pdf file in android? i want to build an app like RepliGo reader. So, Please enlighten me to read pdf by using android sdk or ndk.
Learn Java
Download the SDK with Eclipse
Work through some tutorials to get a flavour of programming on Android
Have a look at this tutorial on reading pdfs in Java
Write your app!

Categories

Resources