Currently, I'm trying to convert a png/jpg file to a pdf in a Xamarin iOS project. I already made some bindings to use your Obj-C functions like addAnnotBitmap but it doest not seem to make the job. Maybe I'm not doing the right operations or the right "Init" functions before adding a annotation or image.
Can you provide me a example of How to add an image to a pdf file in Xamarin iOS ? I have a png/jpg file and I want to put it on a PDFDoc and save the doc as a pdf file.
if I correctly understood, you need to create a new file starting from an image (png or jpg), but addAnnotBitmap method creates an annotation in a valid pdf instance, so you cannot use this method to create a file.
You should first create a pdf file with an empty page, then you can use addAnnotBitmap method to add the image as annotation.
I have created a new pdf file with Create and SetCache in a path with a new page with the right size. I have an image file that I have translated to a PDFDocImage with NewImageJPEG and with that I'm using AddAnnotBitmap to add it to the page and I'm saving the doc at the end. But the resulting pdf file is just a white page at the size of the image.
I tried another way of doing this : using PageContent and DrawImage but I cannot bind the type PDF_PAGE_IMAGE to the xamarin bindings library.