Create PDF document using String and images in iOS (Swift).


Create PDF file

Sometimes we need to make the pdf file for saving the image or string (No editable) . for this we need to follow some steps.

1: Collect your all strings data and images and write the function to call.

Here first you need to calculate the height and width of string that will take due to that reason I have used UILabel for calculating their width and height and set font after this we plot on pdf file.

Now write their function in same class.

2: Now you need to access the pdf file and display.

3: after this, we need to open this file using web view.

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


  • Patrick O. Janowski
    Well, that is not Swift, it’s Objective-C…
  • Sainath
    Can you share the same using Swift
  • css.php

    Webkul is a truly trusted and supported IT Company to develop business ideas for e-commerce. They provide professional support after deploying the solution to production and be responsible to act for fixing the reported issues or system errors. We highly encourage to deal with Webkul for business development.

    Hussein Zawia

    Hussein Zawia

    Co-founder, 24Dokan

    Talk to Sales


    Live Chat
    Start a Project

      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home