Solved: html2pdf / jsPDF elements are cut off in the PDF

So I am using some JavaScript libraries in my Apache Cordova app to save some HTML to a PDF file, which can then be shared via email and social.
The problem was that the rendered content of the HTML element is only as wide as the parent element, which caused me some headaches as the content of the PDF (like the tables and text) were cut off at the width of the parent element.

The parent element was – in my case – simpy as wide as the browser’s viewport, which is kind of bad on a mobile device. So I tried several things – without much success. At last, I have had to use a dirtly little hack to make the canvas/render area wider.

I simply inserted a div with a fixed width of – in this case – 1500px. That fixed it for me.

Surely it is not nice code, and there may must be a way to do it within the JavaScript, but until I find out how, I will resort to this solution.

Cordova Ajax Request failed on iOS because of invalid SSL certificate

When developing with Cordova for iOS, you often make Ajax requests to SSL-encrypted hosts, such as APIs.

Sometimes, these SSL certificates are not valid (or self signed), so iOS breaks the call and sends out an error message to the console in xcode.

To get around this error, we can tell iOS to simply ignore invalid certificates.

Open the file yourproject/platforms/ios/appname/Classes/AppDelegate.m  and insert the following code at the end:

Then run the app from xcode or cordova to check whether it is working now.

Apache Cordova: Create a signed release APK – Easy HowTo

To upload an app to the Google Play Store, you need to sign it first.

There are a lot of tutorials out there, some of which are simply overwhelming, to say the least.

Here is my very simple solution to create a signed APK which you can upload to the Play Store.

Apache Cordova: Create a signed release APK – Easy HowTo weiterlesen

Apache Cordova: iOS click event not working – Quick „how to“

When you are using Apache Cordova to create apps, you will most likely use click  events to navigate from one view to another or to do other stuff.

This all works fine on Android devices, but iOS is not doing anything – and you won’t get an error in the debug console, either.

The problem is that iOS is not sending a click  event, but touchstart .

So your event listener should look somewhat like the following.

This will let you register your event listener for both the click event  and the touchstart event .