iOS Question B4i PDF creation ?

Cain Soft

Member
Licensed User
Longtime User
Hi everyone,
Is there any possibility to create PDF file from JPG images merged together ? One page equals one image.
I searched the forum but only found Android examples.
Thanks in advance.
 

Semen Matusovskiy

Well-Known Member
Licensed User
I'd say there is a lot of ways. IOS supports PDF very good. Another question - which way is simpliest.
Personally, I like to convert HTML to PDF.

I reconstructed a sample, which I posted somehow. Due to forum limitation, I removed jpg files. If you want to test, unzip and add own 1.jpg, 2.jpg, 3.jpg, 4.jpg to folder Files. Of course, you need to set own bundle id and certificates.

Some comments to code. A sample assumes A4. If you want another paper size, correct #define kPaperSizeA4 CGSizeMake (595.2, 841.8)
Simply multiply width, height in inches to 72 (points per inch). Also you can correct paddings (also in pt) - topPadding etc.

You can also send a prepared PDF to itself (uncomment SMTP block.
 

Attachments

  • s19.zip
    4.5 KB · Views: 114
Upvote 0
Top