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

TOPIC:

How add UIimage 10 years 6 months ago #4281

  • superpisu
  • superpisu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 0
i try to add Uiimage to pdf i found this in doc :

bool Page_addAnnotBitmap( PDF_PAGE page, CGImageRef bitmap, bool has_alpha, const PDF_RECT *rect )

but in PDFIOS.h

bool Page_addAnnotBitmap( PDF_PAGE page, PDF_MATRIX matrix, CGImageRef bitmap, bool has_alpha, const PDF_RECT *rect );

you can write me simple code for add image ?

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

How add UIimage 10 years 6 months ago #4284

  • superpisu
  • superpisu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 0
my code :
     PDF_RECT rect;
    PDFVPage *vpage = [m_view vGetPage:pageno];
    PDF_PAGE page = [vpage GetPage];
    Page_objsStart(page);
    PDF_MATRIX mat = [vpage CreateMatrix];

   
    
    UIImage *ptimg = [UIImage imageNamed:@"test.png"];
    rect.bottom=300;
    rect.top=0;
    rect.left=0;
    rect.right=300;
    Page_addAnnotBitmap(page, mat,ptimg.CGImage, true, &rect);

    Matrix_destroy(mat);
    [m_view vRenderPage:pageno];
    m_modified = (m_rects_cnt != 0);
    m_rects_cnt = 0;
    m_rects_drawing = false;
    m_status = sta_none;
    
    
    [self refresh];
    Document_save(m_doc);


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

How add UIimage 10 years 6 months ago #4295

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
for Page_addAnnotBitmap, you shall:
--invoke Document_SetCacheData when opened.
--CGImageRef must in RGBA 32-bits format.

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

How add UIimage 10 years 6 months ago #4305

  • superpisu
  • superpisu's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 6
  • Thank you received: 0
not found Document_SetCacheData in ios doc

and image is RGBA 32-bits format

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

How add UIimage 10 years 5 months ago #4307

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 1123
  • Thank you received: 73
OK, it seems, we forgot to add this method.
we'll update recently.

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

How add UIimage 10 years 5 months ago #4313

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Hi,

a new demo version is now available, with Document_created and Document_setCache methods:

www.androidpdf.mobi/download/download-io...56-ios-pdfviewer-171

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

  • Page:
  • 1
  • 2
Powered by Kunena Forum