- 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
zoom problem
IP: 192.168.0.70
12 years 8 months ago #3362
by truculent
zoom problem was created by truculent
hi
our problem almost solve [our reader ready for connect to our app for release]!
but we have bad problem
[annot ok - thumbnail ok - all of feature are okay]
but zoom not work as well !
some time when pinching for zoom , zoomin not happened
another problem when open a pdf & zoom it then want too read right side of content it going to another page or bugyy
but we have bad problem
but zoom not work as well !
some time when pinching for zoom , zoomin not happened
another problem when open a pdf & zoom it then want too read right side of content it going to another page or bugyy
IP: 192.168.0.149
12 years 8 months ago #3389
by emanuele
Replied by emanuele on topic zoom problem
hi,
to solve your problem with swipe when a page is zoomed, you can modify vGetDeltaToCenterPage method in PDFV.m file.
Something like:
-(void)vGetDeltaToCenterPage:(int)pageno : (int *)dx : (int *)dy
{
if( m_pages == NULL || m_doc == NULL || m_w <= 0 || m_h <= 0 || m_scale > m_scale_min) return;
struct PDFCell *ccur = m_cells;
struct PDFCell *cend = ccur + m_cells_cnt;
....
}
with this solution you execute this method only when a page is not zoomed
to solve your problem with swipe when a page is zoomed, you can modify vGetDeltaToCenterPage method in PDFV.m file.
Something like:
-(void)vGetDeltaToCenterPage:(int)pageno : (int *)dx : (int *)dy
{
if( m_pages == NULL || m_doc == NULL || m_w <= 0 || m_h <= 0 || m_scale > m_scale_min) return;
struct PDFCell *ccur = m_cells;
struct PDFCell *cend = ccur + m_cells_cnt;
....
}
with this solution you execute this method only when a page is not zoomed
IP: 192.168.0.70
12 years 8 months ago #3403
by truculent
Replied by truculent on topic zoom problem
thank you 
but is there anyway for fix when a page zoomed & can to goto another page with swipe ? [but not Like LAst tht buggy
]
but is there anyway for fix when a page zoomed & can to goto another page with swipe ? [but not Like LAst tht buggy
IP: 192.168.0.70
12 years 8 months ago #3430
by truculent
Replied by truculent on topic zoom problem
my last question not answered yet 
i have another problem !
but it's very very funny!
some time zoom not work [i think cant detect 2 finger touch as well !]but really really happened some times
& it's very bad
we fix all of problem with your help
but zoom [basic feature not work well ]!
i have another problem !
but it's very very funny!
some time zoom not work [i think cant detect 2 finger touch as well !]but really really happened some times
& it's very bad
we fix all of problem with your help
IP: 192.168.0.149
12 years 8 months ago #3456
by emanuele
Replied by emanuele on topic zoom problem
I found a possible solution for your problem: I add a BOOL variable to vGetDeltaToCenterPage, like this:
-(void)vGetDeltaToCenterPage:(int)pageno :(int *)dx :(int *)dy :(BOOL)swiping;
and in .m file I change the method implementation:
-(void)vGetDeltaToCenterPage:(int)pageno : (int *)dx : (int *)dy :(BOOL)swiping
{
if (!swiping) {
if( m_pages == NULL || m_doc == NULL || m_w <= 0 || m_h <= 0 || m_scale > m_scale_min) 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;
*dx = x - m_x;
*dy = y - m_y;
}
Now you have to set boolean to YES only in onSwipe method calls, with the exception of last call to vGetDeltaToCenterPage; in the other calls you have to set boolean to NO.
In this way when a page is zoomed you can go to next/prev page with swipe
-(void)vGetDeltaToCenterPage:(int)pageno :(int *)dx :(int *)dy :(BOOL)swiping;
and in .m file I change the method implementation:
-(void)vGetDeltaToCenterPage:(int)pageno : (int *)dx : (int *)dy :(BOOL)swiping
{
if (!swiping) {
if( m_pages == NULL || m_doc == NULL || m_w <= 0 || m_h <= 0 || m_scale > m_scale_min) 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;
*dx = x - m_x;
*dy = y - m_y;
}
Now you have to set boolean to YES only in onSwipe method calls, with the exception of last call to vGetDeltaToCenterPage; in the other calls you have to set boolean to NO.
In this way when a page is zoomed you can go to next/prev page with swipe
IP: 192.168.0.70
12 years 8 months ago #3474
by truculent
Replied by truculent on topic zoom problem
hi dear emanuele 
in your PDFV you have 2 method vGetDeltaToCenterPage 1 on of them for @interface PDFVDual: PDFV
another for @interface PDFV : NSObject !
i changed for @interface PDFV : NSObject
-(void)vGetDeltaToCenterPage:(int)pageno : (int *)dx : (int *)dy :(BOOL)swiping;
{
if (!swiping) {
if( m_pages == NULL || m_doc == NULL || m_w <= 0 || m_h <= 0 || m_scale > m_scale_min) 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;
*dx = x - m_x;
*dy = y - m_y;
swiping = NO;
}
& all in all of call this method in onSwip method pass YES for swiping ! & in all of call [expect onswipe] pass NO to this method! it's work but not good ;( [we use double page Right view mode ] ---> not doual page only on page show & we customize when rotate againe only page show !
i send you my PDFV classes. please check it ! it think some thing going wrong!
truculent.dl.rapidpars.com/17843/1979443/cnnu87920pm/PDFV.zip
please help me
in your PDFV you have 2 method vGetDeltaToCenterPage 1 on of them for @interface PDFVDual: PDFV
another for @interface PDFV : NSObject !
i changed for @interface PDFV : NSObject
-(void)vGetDeltaToCenterPage:(int)pageno : (int *)dx : (int *)dy :(BOOL)swiping;
{
if (!swiping) {
if( m_pages == NULL || m_doc == NULL || m_w <= 0 || m_h <= 0 || m_scale > m_scale_min) 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;
*dx = x - m_x;
*dy = y - m_y;
swiping = NO;
}
& all in all of call this method in onSwip method pass YES for swiping ! & in all of call [expect onswipe] pass NO to this method! it's work but not good ;( [we use double page Right view mode ] ---> not doual page only on page show & we customize when rotate againe only page show !
i send you my PDFV classes. please check it ! it think some thing going wrong!
truculent.dl.rapidpars.com/17843/1979443/cnnu87920pm/PDFV.zip
please help me
Time to create page: 0.481 seconds