[SOLVED]how to set the position of PDFViwThumb - 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: [SOLVED]how to set the position of PDFViwThumb

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

  • jouathen
  • jouathen's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Karma: 1
  • Thank you received: 0
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]


Thanks.
Andy
Attachments:
Last edit: by marcoP. Reason: Closing the post
The topic has been locked.

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

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 846
  • Karma: 43
  • Thank you received: 12
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 4 years 2 months ago #7129

  • jouathen
  • jouathen's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Karma: 1
  • Thank you received: 0
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 4 years 2 months ago #7130

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 846
  • Karma: 43
  • Thank you received: 12
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 4 years 2 months ago #7131

  • Joyce
  • Joyce's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 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 4 years 1 week ago #7656

  • imran.nazeer
  • imran.nazeer's Avatar
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 27
  • Thank you received: 0
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.
  • Page:
  • 1
Powered by Kunena Forum