• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps PDF Printing not accepting orientation

I have a strange issue with trying to print to PDF or even to a wireless printer in that I cannot get the orientation to change to landscape. I use the following code to set landscape mode as the MediaSize.

PrintAttributes attrib = new PrintAttributes.Builder()
.setMinMargins(new PrintAttributes.Margins(0,0,0,0))
.setMediaSize(PrintAttributes.MediaSize.NA_LETTER.asLandscape())
.setColorMode(PrintAttributes.COLOR_MODE_COLOR)
.build();

printManager.print("Document", printAdapter, attrib);


If I breakpoint at the last time and check attrib, it is correct with landscape being passed into the print function.but when OnLayout is called after this, checking newAttributes passed into the function shows the orientation as portrait and not the select landscape. The only fix is to manually select this in the preview. Not ideal for the user to have to do this each time.

Now, here's the strange part. I have 2 systems with different LCD's. A 7 inch one with default resolution of 800x1280 in portrait mode timing but I change this to landscape when Android boots up. It is fixed in this landscape orientation. The second system is an 11.6" 1920x1080 with landscape mode timing. It too is fixed in this landscape mode and cannot rotate.

If I run the same application on the device with the 1920x1080 display, the printout preview is in landscape as expected but if I change the code to force portrait as a test, the preview remains in landscape mode and I have to manually select this to the correct orientation.

Printing without changing the orientation to the correct one causes the wrong orientation to be printed.

I've checked the source code for PrintDocumentAdapter and the setting for landscape should be working.

Why is the landscape/portrait mode not changing with the above code? All searches online point to this as the correct way to change the orientation but it just doesn't work. I need a solution as having the user change this each time is not the ideal way to do this.

Guest Account

Hmm, it does seem a bit crap.

There are apps that can require a PIN to access other apps: you could probably use one of those (on his account) to lock him out of the Settings, but you'd also have to lock him from the Play Store to ensure he couldn't uninstall it that way.

I don't have a recent Samsung tablet so can't say for sure what the options there are (I believe there are some extra options for multi-accounts on tablets, and Samsung modify Android a lot), but I can't find anything on my phone that does anything sensible like require my fingerprint to switch to the admin account. Which, as I say, seems extremely stupid (though for a company who have so many smart people on the payroll it is amazing how many stupid things Google do).

Offline speech recognition

On my S10, there was an option to enable "Faster voice typing" in the GBoard which set GBoard to use the offline speech recognition by default. I liked this feature, because I found it to be much faster AND more accurate than the online mode.

On my S20, there is no such option, strangely. If I put the phone in airplane mode, it will automatically switch over to using the offline speech recognition library, but there doesn't appear to be a way to set it to this mode by default. Does anyone know of a way to accomplish this?

Remove tasker - Tasker

Hello Thom,
No, that doesn't work.
I searched the net & the problem is definitely with SETTINGS; not with TASKER & it is an old problem that Android still carries from previous releases. I think it was reported on release 3 for the first time;
still not fixed. I tried some fixes / suggestions that I found, but none worked so far.
Looks to me that the only solution is to flash/reset the phone.
Thanks for the help.

I know I'm popping in late..

I had a similar issue with Tasker once, wherein I was doing some testing which involved forwarding text messages. I chose my daughter as the test forward. After finishing with playtime, I deleted the profile, but the task remained, and each text I received was going to my daughter as well. I had to recreate the profile, EXACTLY as it had been, and then delete the task and profile. Try that angle.

Filter

Back
Top Bottom