I have tried following the solution to modify the position of thumbnail (although instead of horizontal, I am now using vertical one).
By setting int top = 10, the first thumbnail now locates at my desired position.
Yet, when I start scrolling the pdf, I found out that the thumbnail doesn't change accordingly (e.g. upon scrolling from page 1 to page 2 or even page 3, the thumbnail doesn't change, while scrolling up to page 4 will the selected thumbnail changes from 1 to 4).
I have identified the responsible codes for this and which should be vGetDeltaToCenterPage::: in PDFV.m .
I have added the same method for the interface PDFVThmb (so that the codes in other interfaces won't be affected) and are as follows:
-(void)vGetDeltaToCenterPage:(int)pageno : (int *)dx : (int *)dy
{
if( m_pages == NULL || m_doc == NULL || m_w <= 0 || m_h <= 0 ) return;
PDFVPage *vpage = m_pages[pageno];
int left = [vpage GetX] - m_page_gap/2;
int top = [vpage GetY] - m_page_gap/2;
int w = [vpage GetWidth] + m_page_gap;
int h = [vpage GetHeight] + m_page_gap;
int x = left + (w - m_w)/2;
int y = top + (h - (m_h/2+10))/2; <------ This line should be modified
*dx = x - m_x;
*dy = y - m_y;
}
- (void)vLayout
{
......
int top = 10; // original version: int top = m_h/2;
......
}
The original version of that line is
int y = top + (h - m_h)/2;
Anyone can help me on the calculation? I have tried modifying the line but there are still some cases that the thumbnail doesn't change accordingly.
Any help is appreciated.