How to show 1 slide per each pageon Landscape mode - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about Android development and PDF
  • Page:
  • 1

TOPIC: How to show 1 slide per each pageon Landscape mode

How to show 1 slide per each pageon Landscape mode 4 years 3 months ago #6733

  • lovelyingtam
  • lovelyingtam's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Hi. I'm Ellie.
  • Posts: 2
  • Thank you received: 0
Hi,
I am using Radaee-PDFViewer2.9.10-Lib.

and here is MyCustomView.

I try to display PDF in Protail mode, it was showing 1 slide per each page.
But, in Landscape mode, it shows 2 slide per each page.

I would like to know that how to make the reader shows 1 slide on each page in Landscape mode?

Thanks,
Ellie


public class MyCustomView extends View implements
		PDFView.PDFViewListener {

	PDFView m_pdv;
	public boolean m_lock_resize = false;
	private int m_save_w = 0;
	private int m_save_h = 0;
	private int m_cur_page = 0;

	CustomPDFReaderListener listener;
	int gapSize;

	public MyCustomView(Context context) {
		super(context);
	}

	public MyCustomView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	protected void onDraw(Canvas canvas) {
		if (m_pdv != null) {
			m_pdv.vDraw(canvas);
		}
	}

	public void readerGotoPage(int pageno) {
		m_pdv.vGotoPage(pageno);
		invalidate();
	}

	public void open(Document doc, CustomPDFReaderListener listener) {
		this.listener = listener;

		if (gapSize == 0) {
			gapSize = (int) getResources().getDimension(
					R.dimen.pdf_gap_detail_page_reader);
		}

		m_pdv = new PDFViewDual(getContext());
		m_pdv.vOpen(doc, gapSize, 0x00000000, this);
		invalidate();
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		if (m_pdv != null)
			return m_pdv.vTouchEvent(event);
		else
			return true;
	}

	protected void onSizeChanged(int w, int h, int oldw, int oldh) {
		m_save_w = w;
		m_save_h = h;
		if (m_pdv != null && !m_lock_resize)
			m_pdv.vResize(w, h);
	}

	public void close() {
		if (m_pdv != null) {
			m_pdv.vClose();
		}
		m_pdv = null;
	}

	public void OnPDFPageChanged(int pageno) {
		m_cur_page = pageno;
		if (listener != null) {
			listener.OnPDFPageChanged(pageno);
		}
	}

	public boolean OnPDFDoubleTapped(float x, float y) {
		return false;
	}

	public boolean OnPDFSingleTapped(float x, float y) {
		if (listener != null) {
			listener.OnPDFSingleTapped();
		}
		return false;
	}

	public void OnPDFLongPressed(float x, float y) {
	}

	public void OnPDFShowPressed(float x, float y) {
	}

	public void OnPDFSelectEnd() {
	}

	public void OnPDFFound(boolean found) {
	}

	public void OnPDFInvalidate(boolean post) {
		if (post)
			postInvalidate();
		else
			invalidate();
	}

	public void OnPDFPageDisplayed(Canvas canvas, PDFVPage vpage) {
	}

	@Override
	public void computeScroll() {
		if (m_pdv == null)
			return;
		m_pdv.vComputeScroll();
	}

	public void OnPDFSelecting(Canvas canvas, int[] rect1, int[] rect2) {
	}

}

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

Thanks,
Ellie

How to show 1 slide per each pageon Landscape mode 4 years 3 months ago #6737

  • Davide
  • Davide's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 814
  • Karma: 17
  • Thank you received: 65
Hi,

you can set

def_view = 3

in default_config() method of Global class

or add this

PDFViewDual view = new PDFViewDual(this.getContext());
        	boolean paras[] = new boolean[m_doc.GetPageCount()];
        	int cur = 0;
        	while( cur < paras.length )
        	{
        		paras[cur] = false;
        		cur++;
        	}
        	view.vSetLayoutPara(null, paras, m_rtol);
            m_view = view;

in your own code.

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

How to show 1 slide per each pageon Landscape mode 4 years 3 months ago #6759

  • lovelyingtam
  • lovelyingtam's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Hi. I'm Ellie.
  • Posts: 2
  • Thank you received: 0
Cool, it's work now!
Thank you so much. :woohoo:

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

Thanks,
Ellie
  • Page:
  • 1
Powered by Kunena Forum