Hi,
this is the standard behaviour of the demo project, but you can customize the vLayout method of the view mode in use to set the correct page rect.
Now, the page position is based on the biggest page size.
For example, for vertical view mode, the vLayout is:
-(void)vLayout
{
if( m_w <= 0 || m_h <= 0 || !m_pages ) return;
PDF_SIZE sz = [m_doc getPagesMaxSize];
m_scale_min = (m_w - m_page_gap) / sz.cx;
m_scale_max = m_scale_min * g_zoom_level;
if( m_scale < m_scale_min ) m_scale = m_scale_min;
if( m_scale > m_scale_max ) m_scale = m_scale_max;
int cur = 0;
int end = m_pages_cnt;
int left = m_page_gap_half;
int top = m_page_gap_half;
while( cur < end )
{
PDFVPage *vpage = m_pages[cur];
[vpage SetRect:left:top:m_scale];
top += [vpage GetHeight] + m_page_gap;
cur++;
}
m_docw = sz.cx * m_scale;
m_doch = top - m_page_gap_half;
}
To center the page you can do something like:
-(void)vLayout
{
if( m_w <= 0 || m_h <= 0 || !m_pages ) return;
PDF_SIZE sz = [m_doc getPagesMaxSize];
m_scale_min = (m_w - m_page_gap) / sz.cx;
m_scale_max = m_scale_min * g_zoom_level;
if( m_scale < m_scale_min ) m_scale = m_scale_min;
if( m_scale > m_scale_max ) m_scale = m_scale_max;
int cur = 0;
int end = m_pages_cnt;
int left = m_page_gap_half;
int top = m_page_gap_half;
while( cur < end )
{
PDFVPage *vpage = m_pages[cur];
left = (m_w - [vpage GetWidth]) / 2; // Set a custom left value
[vpage SetRect:left:top:m_scale];
top += [vpage GetHeight] + m_page_gap;
cur++;
}
m_docw = sz.cx * m_scale;
m_doch = top - m_page_gap_half;
}
You can find vLayout method in PDFV class (pay attention to modify the vLayout method of the correct implementation, in this case PDFVVert)