- Posts: 10
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about iOS development and PDF
how to add a picture
- ecosignitchile
- Topic Author
- Offline
- New Member
-
Less
More
10 years 6 months ago #9356
by ecosignitchile
how to add a picture was created by ecosignitchile
Hi , i need to add a picture like a stamp ... what is the method to do it ?
thanks !
thanks !
10 years 5 months ago #9365
by stronglee
Replied by stronglee on topic how to add a picture
Hi, PDFPage class have method
-(bool)addAnnotBitmap:(CGImageRef) bitmap :(bool) has_alpha :(const PDF_RECT *) rect;
have try
-(bool)addAnnotBitmap:(CGImageRef) bitmap :(bool) has_alpha :(const PDF_RECT *) rect;
have try
- ecosignitchile
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 10
- Thank you received: 0
10 years 5 months ago #9377
by ecosignitchile
Replied by ecosignitchile on topic how to add a picture
thanks ! can you show me an example please : ) ???
10 years 5 months ago #9382
by emanuele
Replied by emanuele on topic how to add a picture
Hi,
here is an example to add a picture in the current page (you can add this method in PDFView class):
the first part set the cache file (is needed to add an image).
I tried that method with this simple code:
here is an example to add a picture in the current page (you can add this method in PDFView class):
Code:
- (void)vAddImage:(NSString *)image withRect:(PDF_RECT)rect
{
NSString *tp = NSTemporaryDirectory();
tp = [tp stringByAppendingPathComponent:@"cache.dat"];
[m_doc setCache:tp];
PDFPage *page = [m_doc page:m_cur_page];
CGImageRef ref = [[UIImage imageNamed:image] CGImage];
[page addAnnotBitmap:ref :NO :&rect];
[m_view vRenderSync:m_cur_page];
[self refresh];
[m_doc save];
}
the first part set the cache file (is needed to add an image).
I tried that method with this simple code:
Code:
PDF_RECT rect;
rect.left = 100;
rect.right = 57;
rect.top = 100;
rect.bottom = 57;
[m_view vAddImage:@"icon57.png" withRect:rect];
- ecosignitchile
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 10
- Thank you received: 0
10 years 5 months ago #9384
by ecosignitchile
Replied by ecosignitchile on topic how to add a picture
thanks i get errors on this lines :
[m_view vRenderSync:m_cur_page];
where do i get page number ?
[m_view vRenderSync:m_cur_page];
vRenderSync this method looks like doesn't exist
[self refresh];
dont know : )
thanks !
[m_view vRenderSync:m_cur_page];
where do i get page number ?
[m_view vRenderSync:m_cur_page];
vRenderSync this method looks like doesn't exist
[self refresh];
dont know : )
thanks !
Time to create page: 0.475 seconds