How add UIimage - 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
  • 2

TOPIC: How add UIimage

How add UIimage 5 years 1 month ago #4281

  • superpisu
  • superpisu's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • 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 5 years 1 month ago #4284

  • superpisu
  • superpisu's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • 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 5 years 1 month ago #4295

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 847
  • Karma: 43
  • Thank you received: 12
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 5 years 1 month ago #4305

  • superpisu
  • superpisu's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • 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 5 years 1 month ago #4307

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 847
  • Karma: 43
  • Thank you received: 12
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 5 years 1 month ago #4313

  • emanuele
  • emanuele's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 525
  • Karma: 20
  • Thank you received: 60
Hi,

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

http://www.androidpdf.mobi/download/download-ios/file/56-ios-pdfviewer-171

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

  • Page:
  • 1
  • 2
Powered by Kunena Forum