PDFVDual page position - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about iOS development and PDF
  • Page:
  • 1

TOPIC: PDFVDual page position

PDFVDual page position 4 years 4 weeks ago #7700

  • Rossi
  • Rossi's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 49
  • Karma: 1
  • 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 4 years 3 weeks ago #7727

  • emanuele
  • emanuele's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 523
  • Karma: 20
  • Thank you received: 60
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 4 years 3 weeks ago #7728

  • Rossi
  • Rossi's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 49
  • Karma: 1
  • 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 4 years 3 weeks ago #7730

  • emanuele
  • emanuele's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 523
  • Karma: 20
  • Thank you received: 60
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 4 years 3 weeks ago #7731

  • Rossi
  • Rossi's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 49
  • Karma: 1
  • 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