RadaeePDF.com :: Topic: center page horizontal und vertical (1/1)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Questions about Android development and PDF

TOPIC: center page horizontal und vertical

center page horizontal und vertical 3 years 1 month ago #7221

  • custompdf
  • custompdf's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 14
  • Karma: 0
I'm using PDFViewHorz to display the pdf when in portrait view.
I need to fit the pdf to height and because the pdf view height is not the the full screen height I can't use PDFViewVert or so.
It's a single site pdf and i want the page to be centered horizontally.
I tried to set Global.def_view = 3, tried to set the m_view.vSetPos(pos, w/2, h/2); but nothing works.
the pdf is centered vertical but I need both. vertical and horizontal.
Whatever I tried the pdf page stays at the left screen border.
Any ideas?

Because of the project deadline I really would need a quick answer if anyone knows how to get this work!
Last Edit: 3 years 1 month ago by Chaâbane.
The topic has been locked.

center page horizontal und vertical 3 years 1 month ago #7226

  • radaee
  • radaee's Avatar
  • OFFLINE
  • Moderator
  • Posts: 825
  • Thank you received: 10
  • Karma: 43
set def_view = 3 in Global.default_config(), but not out of Global class.
or invoke PDFReader.PDFSetViewer(3), at runtime.
The topic has been locked.

center page horizontal und vertical 3 years 1 month ago #7228

  • custompdf
  • custompdf's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 14
  • Karma: 0
I do!
public static void default_config() {
		selColor = 0x400000C0;// selection color
		fling_dis = 1.0f;// 0.5-2
		fling_speed = 0.1f;// 0.05 - 0.2
		def_view = 3;// 0,1,2,3,4,5,6 0:vertical 1:horizon 2:curl effect 3:single
						// 4:SingleEx 5:Reflow, 6:show 2 page as 1 page in land
						// scape mode
		render_mode = 1;// 0,1,2 0:draft 1:normal 2:best
		dark_mode = false;// dark mode
		zoomLevel = 3;
		need_time_span = true;
		setAnnotTransparency(Color.TRANSPARENT);
	}


Still the same. Pdf page sticks on left corner
The topic has been locked.

center page horizontal und vertical 3 years 1 month ago #7254

  • custompdf
  • custompdf's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 14
  • Karma: 0
So there is no other way?
The topic has been locked.

center page horizontal und vertical 3 years 4 weeks ago #7518

  • cerv82
  • cerv82's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 19
  • Karma: 0
I'm getting the same incorrect behavior, I could make the Page get centered using the PDFViewVert, but the content is being cropped at the bottom.

Any update on this?
The topic has been locked.

center page horizontal und vertical 3 years 2 weeks ago #7615

  • cerv82
  • cerv82's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 19
  • Karma: 0
I know that is kind of late but I just figured out how to center the page, I'm showing only a single page and it fits the page View height/width. I can share my code, just let me know.
.custompdf wrote:
So there is no other way?
The topic has been locked.
Powered by Kunena Forum