Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about iOS development and PDF
  • Page:
  • 1

TOPIC:

Orientation Problem 10 years 9 months ago #3003

  • truculent
  • truculent's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 64
  • Thank you received: 0
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

Please Log in or Create an account to join the conversation.

Orientation Problem 10 years 9 months ago #3005

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
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.
The following user(s) said Thank You: patel_patel_patel

Please Log in or Create an account to join the conversation.

Orientation Problem 10 years 9 months ago #3010

  • truculent
  • truculent's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 64
  • Thank you received: 0
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 :(

Please Log in or Create an account to join the conversation.

Orientation Problem 10 years 9 months ago #3018

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
these codes shall works:
-(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;
}
The following user(s) said Thank You: patel_patel_patel

Please Log in or Create an account to join the conversation.

Last edit: by .

Orientation Problem 10 years 8 months ago #3529

  • truculent
  • truculent's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 64
  • Thank you received: 0
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

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum