Hi,
I'm migrating from PDFWriter Library to Printing Library to be compatible with all alphabets.
I started from this: https://www.b4x.com/android/forum/threads/printing-and-pdf-creation.76712/#content
My app produce PDFs with text and pictures that usually are about 1MB/page.
The pictures are loaded with LoadBitmapSample and I cannot reduce more the resolution.
When I use a Samsung S4 smartphone with Android 5.0.
In debug mode.
If I create one page PDF is all OK, but if I try to create a multipage file with more than 3 or 4 pages, after that "pdf.WriteToStream(out)" instruction start, my app stops and appear the message "Unfortunately my app has stopped". In the Log of B4A doesn't appear errors. If I put a Try...Catch statement around the pdf.WriteToStream I don't catch anything.
In release mode.
The app stops in the same way. I obtain the same message, but I obtain this error log as well:
When I use a Huawei with Android 4.4.2 in debug or release mode.
The multipage (my maximum target is 10 pages) PDF is created, but when I open it, some pictures are correct, other are corrupted (partially covered by horizzontal lines).
Is this a memory problem? How can I fix it?
Thanks a Lot to everybody can help.
I'm migrating from PDFWriter Library to Printing Library to be compatible with all alphabets.
I started from this: https://www.b4x.com/android/forum/threads/printing-and-pdf-creation.76712/#content
My app produce PDFs with text and pictures that usually are about 1MB/page.
The pictures are loaded with LoadBitmapSample and I cannot reduce more the resolution.
When I use a Samsung S4 smartphone with Android 5.0.
In debug mode.
If I create one page PDF is all OK, but if I try to create a multipage file with more than 3 or 4 pages, after that "pdf.WriteToStream(out)" instruction start, my app stops and appear the message "Unfortunately my app has stopped". In the Log of B4A doesn't appear errors. If I put a Try...Catch statement around the pdf.WriteToStream I don't catch anything.
In release mode.
The app stops in the same way. I obtain the same message, but I obtain this error log as well:
B4X:
** Service (starter) Create **
filters_activity_create (java line: 411)
java.lang.RuntimeException: Object should first be initialized (Map).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.collections.Map.Get(Map.java:65)
at it.ritmo.setandgo.filters._activity_create(filters.java:411)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at it.ritmo.setandgo.filters.afterFirstLayout(filters.java:102)
at it.ritmo.setandgo.filters.access$000(filters.java:17)
at it.ritmo.setandgo.filters$WaitForLayout.run(filters.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5951)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
java.lang.RuntimeException: Object should first be initialized (Map).
When I use a Huawei with Android 4.4.2 in debug or release mode.
The multipage (my maximum target is 10 pages) PDF is created, but when I open it, some pictures are correct, other are corrupted (partially covered by horizzontal lines).
Is this a memory problem? How can I fix it?
Thanks a Lot to everybody can help.