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

TOPIC:

I want to show pdf from certain page to certain page not whole pdf. 4 years 11 months ago #14373

  • apdeveloper
  • apdeveloper's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 67
  • Thank you received: 0
Dear Team,

Currently i am working on a project where i have downloaded a pdf of 50 pages and now i want to show pdf suppose from 5 page no. to 10 page no. only.
Is it possible show pdf like this i dont want to show the whole 50 pages of that pdf.

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

I want to show pdf from certain page to certain page not whole pdf. 4 years 11 months ago #14375

  • federico
  • federico's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 261
  • Thank you received: 18
Dear apdeveloper,
Which kind of programming language are you interested in for this feature?

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

I want to show pdf from certain page to certain page not whole pdf. 4 years 11 months ago #14377

  • apdeveloper
  • apdeveloper's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 67
  • Thank you received: 0
In iOS Swift version or objc i want this funcatinality

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

I want to show pdf from certain page to certain page not whole pdf. 4 years 11 months ago #14378

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
it can create a new class derive from PDFDoc class.
you need to override methods:
-(int)pageCount;
-(PDFPage *)page:(int) pageno;
-(float)pageWidth:(int) pageno;
-(float)pageHeight:(int) pageno;
-(NSString *)pageLabel:(int)pageno;
-(bool)newRootOutline: (NSString *)label :(int) pageno :(float) top;
-(PDFPage *)newPage:(int) pageno :(float) w :(float) h;
-(bool)movePage:(int)pageno1 :(int)pageno2;
rhe second solution shall be:
create a new PDF file and import pages you needed.

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

Last edit: by radaee.

I want to show pdf from certain page to certain page not whole pdf. 4 years 11 months ago #14379

  • apdeveloper
  • apdeveloper's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 67
  • Thank you received: 0
How can i create new pdf and import pages which i need from old pdf using Radaeepdf.

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

I want to show pdf from certain page to certain page not whole pdf. 4 years 11 months ago #14383

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
you must have premium license, and create PDF file in sandbox, which has write access right.
and then objc codes like:
PDFDoc *doc_src;
PDFDoc *doc_dst;
doc_src = [[PDFDoc alloc] init];
doc_dst = [[PDFDoc alloc] init];
[doc_src open:@"source path to extists pdf file"];
[doc_dst open:@"dest path to creating pdf file"];
PDFImportCtx *ctx = [doc_src newImportCtx];
int pgno = page_range_start;
int pgend = page_range_end;
int pgdst = 0;
wile(pgno < pgend)
{
  [ctx import :pgno :pgdst];
  pgno++;
  pgdst++;
}
[doc_dst save];
ctx = nil;
doc_src = nil;
doc_dst = nil;

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

Last edit: by radaee.
Powered by Kunena Forum