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

TOPIC:

PDFVDual page position 9 years 5 months ago #7700

  • Rossi
  • Rossi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 49
  • Thank you received: 0
Hi, with pdfvdual visualization i need to render the pdf with odd page on right and even page on left, so the page number 1 it's visible alone on the right of the view.
In android there is the horzs param but i can do it on ios?

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

PDFVDual page position 9 years 5 months ago #7727

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Hi,
in vOpen method, you should add:

bool *horzs = (bool *)calloc( sizeof(bool), [doc pageCount] );
for (int i = 0; i < m_doc.pageCount; i++) {
if (i > 0) {
horzs = true;
}
}

before the switch that check g_def_view; than you should change the case:3 like that:
m_view = [[PDFVDual alloc] init:false :NULL :0 :horzs :m_doc.pageCount];

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

Last edit: by CBA.

PDFVDual page position 9 years 5 months ago #7728

  • Rossi
  • Rossi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 49
  • Thank you received: 0
hi, i tried your code but i have an EXC_BAD_ACCESS error on
memcpy( m_horz_dual, horzs, sizeof( bool ) * horzs_cnt ); in PDFV.m on line 627

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

PDFVDual page position 9 years 5 months ago #7730

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
sorry, this is the correct code:
for (int i = 0; i < m_doc.pageCount; i++) {
if (i > 0) {
horzs[i] = true;
}
}
The following user(s) said Thank You: Abdikayrov

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

Last edit: by CBA.

PDFVDual page position 9 years 5 months ago #7731

  • Rossi
  • Rossi's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 49
  • Thank you received: 0
Thanks, now works. I don't see the trivial error.

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

  • Page:
  • 1
Powered by Kunena Forum