Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1
  • 2

TOPIC:

Centering pages after seacrh 8 years 8 months ago #10965

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
for the two pages mode, you also have to override the vCenterPage method of PDFLayoutDual, something like that :
@Override
	public void vCenterPage( int pageno )
	{
		if( m_pages == null || m_doc == null || m_w <= 0 || m_h <= 0 ) return;
		int ccur = 0;
		while( ccur < m_cells.length )
		{
			PDFCell cell = m_cells[ccur];
			if( pageno == cell.page_left || pageno == cell.page_right )
			{
				int left = m_cells[ccur].left;
				int w = m_cells[ccur].right - left;
				int x = left + (w - m_w)/2;
				int oldx = m_scroller.getCurrX();
				int oldy = m_scroller.getCurrY();
				m_scroller.startScroll(oldx, oldy, x - oldx, 0);
				break;
			}
			ccur++;
		}
	}

Please Log in or Create an account to join the conversation.

Centering pages after seacrh 8 years 8 months ago #10966

  • half65
  • half65's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 8
  • Thank you received: 0
Thank you, it works

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
  • 2
Powered by Kunena Forum