- Posts: 6
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about iOS development and PDF
Open PDF in single page mode
IP: 192.168.0.70
12 years 5 months ago #4237
by superpisu
Open PDF in single page mode was created by superpisu
How open pdf in sigle page mode ?
in doc i found :
PDF_VIEW PDFV_open( int type, PDF_DOC doc, int page_gap )
Description:
create a Viewer object.
Pamaters:
type 0: vertival view
1: left to right view
2: right to left view
3: single left to right view
4: single right to left view
doc Document object returned from PDF_open().
page_gap gap between pages, in pixels.
Return:
Viewer object or NULL.
but if page_gap = 3 in landscape show 2 pages
i need page mode like android SingleEx is it possible?
in doc i found :
PDF_VIEW PDFV_open( int type, PDF_DOC doc, int page_gap )
Description:
create a Viewer object.
Pamaters:
type 0: vertival view
1: left to right view
2: right to left view
3: single left to right view
4: single right to left view
doc Document object returned from PDF_open().
page_gap gap between pages, in pixels.
Return:
Viewer object or NULL.
but if page_gap = 3 in landscape show 2 pages
i need page mode like android SingleEx is it possible?
IP: 192.168.0.70
12 years 5 months ago #4238
by radaee
Replied by radaee on topic Open PDF in single page mode
this method is deleted.
plz see PDFView.m
plz see 3, 4 case in switch
plz see PDFView.m
Code:
-(void)vOpen:(PDF_DOC)doc :(id<PDFVDelegate>)delegate
{
//GEAR
[self vClose];
//END
m_doc = doc;
//g_PDF_ViewMode =2;
//defView =2;
bool *verts = (bool *)calloc( sizeof(bool), Document_getPageCount(doc) );
switch(defView)
{
case 1:
m_view = [[PDFVHorz alloc] init:false];
break;
case 2:
m_view = [[PDFVHorz alloc] init:true];
break;
case 3:
//for dual view
m_view = [[PDFVDual alloc] init:false :NULL :0 :NULL :0];
//for single view
//m_view = [[PDFVDual alloc] init:false :NULL :0 :verts :Document_getPageCount(doc)];
break;
case 4:
//for dual view
m_view = [[PDFVDual alloc] init:true :NULL :0 :NULL :0];
//for single view
//m_view = [[PDFVDual alloc] init:true :NULL :0 :verts :Document_getPageCount(doc)];
break;
default:
m_view = [[PDFVVert alloc] init];
break;
}
free( verts );
m_type = defView;
struct PDFVThreadBack tback;
tback.OnPageRendered = @selector(OnPageRendered:);
tback.OnFound = @selector(OnFound:);
[m_view vOpen:doc :4 :0xFFCCCCCC : self: &tback];
[m_view vResize:m_w :m_h];
m_timer = [NSTimer scheduledTimerWithTimeInterval:0.03f
target:self selector:@selector(timerFireMethod:)
userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop]addTimer:m_timer forMode:NSDefaultRunLoopMode];
m_status = sta_none;
m_ink = NULL;
m_modified = false;
m_rects = NULL;
m_rects_cnt = 0;
m_rects_max = 0;
m_ellipse = NULL;
m_ellipse_cnt = 0;
m_ellipse_max = 0;
m_cur_page = -1;
m_delegate = delegate;
}
Time to create page: 0.452 seconds