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

TOPIC:

Zoom to column width 9 years 5 months ago #7690

  • dashti
  • dashti's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 10
  • Thank you received: 0
Hi,
I'm developing an android application using PDF SDK while I need to zoom to a specific text column. E.g. in a two column page, if you double tap on a column, the reader should zoom to fit that column. How this is possible with PDF SDK?
Thanks in advance.

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

Zoom to column width 9 years 5 months ago #7693

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
there is no API to achieve this equipement.

Double tap zoom and center the zoom based on the tapped position.

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

Zoom to column width 9 years 5 months ago #7701

  • dashti
  • dashti's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 10
  • Thank you received: 0
So, how should I do zoom "based on tapped position"? How I can find out the proper zoom level?

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

Zoom to column width 9 years 5 months ago #7705

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Thank you received: 65
Hi,
this is the zoom's standard behaviour.
If you want to increase the zoom you have to modify the zoomLevel in default_config() void in Global class (max 5).
With this m_view.vGetScale(); you can get the current scale.
With this m_view.vGetMaxScale(); you can get the max scale.
With this m_view.vGetMinScale(); you can get the min scale.

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

Zoom to column width 9 years 5 months ago #7761

  • dashti
  • dashti's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 10
  • Thank you received: 0
Hi,

I can see the following code in PDFReader.java
public boolean OnPDFDoubleTapped(float x, float y)
	{
		if( m_status != STA_NORMAL ) return false;
		m_view.vSetScale(m_view.vGetScale() + Global.zoomStep, x, y);
		return true;
	}

This is default action of double tap to increase zoom level. My point is how to find the proper zoom scale to be passed to vSetScale, based on the content width of the position where the user has touched the screen.

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

  • Page:
  • 1
Powered by Kunena Forum