RadaeePDF.com :: Topic: [SOLVED]how to set the position of PDFViwThumb (1/1)
Welcome, Guest
Username: Password: Remember me

Signin/Signup with:

Questions about Android development and PDF

TOPIC: [SOLVED]how to set the position of PDFViwThumb

[SOLVED]how to set the position of PDFViwThumb 3 years 2 months ago #7107

  • jouathen
  • jouathen's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 1
Hi,
I am using "Radaee-PDFViewer2.9.10-Lib.jar" for my android project.
I want to know how to make the preview PDF start on the left hand side,not middle.
[Class PDFViewThumb]
thumb1.png

thumb2.png

Thanks.
Andy
Last Edit: 3 years 2 weeks ago by marcoP. Reason: Closing the post
The topic has been locked.

how to set the position of PDFViwThumb 3 years 2 months ago #7112

  • radaee
  • radaee's Avatar
  • OFFLINE
  • Moderator
  • Posts: 825
  • Thank you received: 10
  • Karma: 43
this need modify much codes. in PDFViewThumb class.
in PDFViewThumb.vSetSel()

int nx = m_pages[pageno].m_x + m_pages[pageno].m_w/2 - m_w/2;
change to m_pages[pageno].m_x + m_page_gap/2

in PDFViewThumb.vSingleTap() do the same.

and may some other codes need to modify.
The topic has been locked.

how to set the position of PDFViwThumb 3 years 2 months ago #7129

  • jouathen
  • jouathen's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
  • Karma: 1
Hi radaee,
Would you mind to help me to modify it, because i cannot find the "PDFViewThumb.vSingleTap()"
and i am not fully understand,sorry. :(
Thanks again,
Andy


This is my code.
public class SuperProtectedPDFThumbView extends PDFThumbView {

	protected PDFViewThumb myPdfThumb;
	public SuperProtectedPDFThumbView(Context context, AttributeSet attrs) {
		super(context, attrs);

		Field privateStringField = null;
		try {
			privateStringField = PDFThumbView.class.getDeclaredField("m_thumb");
			privateStringField.setAccessible(true);
		} catch (NoSuchFieldException e1) {
			e1.printStackTrace();
		}

		try {
			myPdfThumb = (PDFViewThumb) privateStringField.get(this);
		} catch (IllegalAccessException e) {
			e.printStackTrace();
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		}
		System.out.println("fieldValue = " + myPdfThumb);
	}

	@Override
	public void thumbOpen(Document doc, PDFThumbListener listener) {
		// Global.selColor = 0x00000000;
		// Global.inkColor = getResources().getColor(R.color.pink_dark);

		myPdfThumb.vOpen(doc, 40, 0x00000000, this);
		myPdfThumb.vSetThumbListener(listener);
		myPdfThumb.vResize(getWidth(), getHeight());
	}

	public void thumbGap(int gap) {
		myPdfThumb.vSetPageGap(gap);
	}

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

}
The topic has been locked.

how to set the position of PDFViwThumb 3 years 2 months ago #7130

  • radaee
  • radaee's Avatar
  • OFFLINE
  • Moderator
  • Posts: 825
  • Thank you received: 10
  • Karma: 43
source code of PDFViewThumb only can be editable in professional or premium license.
The topic has been locked.

how to set the position of PDFViwThumb 3 years 2 months ago #7131

  • Joyce
  • Joyce's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
Hi radaee,
I have the same problem in iOS project.
How can I edit the code to set the position of pdf thumb?
Thanks.
The topic has been locked.

how to set the position of PDFViwThumb 3 years 2 weeks ago #7656

In iOS, you should edit PDFV class: in @implementation PDFVThmb you have to change vLayout method and set int left = 0; instead of int left = m_w/2;
The topic has been locked.
Powered by Kunena Forum