- Posts: 64
- 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
Orientation Problem
IP: 192.168.0.70
12 years 8 months ago #3003
by truculent
Orientation Problem was created by truculent
thank you for your quick reply in all of topic!
almos done for us
buy Final problem is orientation !
when we change orientation to landscape mode in ios [ipad]
it going to another View mode [2 page mode ] it's good but very bad not sperate Line with 2 page
it can move a little on Verticaly direction [but our view mode is double page Right ]
another problem is : when switch to Portrait mode view going to incorrect scale
upload7.ir/images/02223523903652244783.png
upload7.ir/images/43933252249038807688.png
almos done for us
buy Final problem is orientation !
when we change orientation to landscape mode in ios [ipad]
it going to another View mode [2 page mode ] it's good but very bad not sperate Line with 2 page
it can move a little on Verticaly direction [but our view mode is double page Right ]
another problem is : when switch to Portrait mode view going to incorrect scale
upload7.ir/images/02223523903652244783.png
upload7.ir/images/43933252249038807688.png
IP: 192.168.0.70
12 years 8 months ago #3005
by radaee
Replied by radaee on topic Orientation Problem
OK, you can use [PDFV vGetDeltaToCenterPage:pageno:&m_swipe_dx:&m_swipe_dy] to center pages.
if you don't want dual page mode, then alloc boolean array, and set all elements to false.
then invoke:
[[PDFVDual alloc] init:false :NULL :0 :horzs :0];
when open document.
in this way, all pages are layouted as single pages.
for scale value:
you can invoke [PDFV vSetScale:0] to zoom back to min-scale.
if you don't want dual page mode, then alloc boolean array, and set all elements to false.
then invoke:
[[PDFVDual alloc] init:false :NULL :0 :horzs :0];
when open document.
in this way, all pages are layouted as single pages.
for scale value:
you can invoke [PDFV vSetScale:0] to zoom back to min-scale.
IP: 192.168.0.70
12 years 8 months ago #3010
by truculent
Replied by truculent on topic Orientation Problem
it's not work 
our paging right to Left ! but it have conflict with your parameter!
after put your code again double page mode enable in landscape mode

i want to have double page mode in landscape mode but with correct scale
& another problem still happen
after chand orientation from Land to portrait , page have incorrect scale
our paging right to Left ! but it have conflict with your parameter!
after put your code again double page mode enable in landscape mode
i want to have double page mode in landscape mode but with correct scale
& another problem still happen
after chand orientation from Land to portrait , page have incorrect scale
IP: 192.168.0.70
12 years 8 months ago - 12 years 8 months ago #3018
by radaee
Replied by radaee on topic Orientation Problem
these codes shall works:
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_cur_page = -1;
m_delegate = delegate;
}
- (CGSize)sizeThatFits:(CGSize)size
{
struct PDFV_POS pos;
[m_view vGetPos:&pos :m_w/2 :m_h/2];
m_w = size.width * m_scale;
m_h = size.height * m_scale;
[m_view vResize:m_w :m_h];
[m_view vSetScale:1];//set scale to min
[m_view vSetPos:&pos :m_w/2 :m_h/2];
[self refresh];
return size;
}
Last edit: 12 years 8 months ago by .
IP: 192.168.0.70
12 years 7 months ago #3529
by truculent
Replied by truculent on topic Orientation Problem
is there any way we have can paging right to left [Double page right] but in landscape mode cane see pdf Like it[full screen] ?
upload7.ir/images/82680131624300240089.png
in your las post you set parameter for fix our problem & it's work!
& result Like it :
upload7.ir/images/68825749745122634864.png
upload7.ir/images/82680131624300240089.png
in your las post you set parameter for fix our problem & it's work!
& result Like it :
upload7.ir/images/68825749745122634864.png
Time to create page: 0.459 seconds