0

I have a project written in Swift 2.0 that exports some HTML written text as a PDF. I want to insert an image into my HTML but have to use quotations for the <img src= "dividerImage.png">. It it is not accepting the quotes because it is already within the url string text quotations as shown:

url = "<h>Title of PDF</h> [image source text here] <body>PDF body text here</body>"

Is what I'm trying to do not possible? I've search online for documentation on this in Swift 2.0 with no luck. Thank you.

ChallengerGuy
  • 2,385
  • 6
  • 27
  • 43

1 Answers1

2

You can use simple quote:

url = "<h>Title of PDF</h> <img src= 'dividerImage.png'> <body>PDF body text here</body>"

or escape double quote:

url = "<h>Title of PDF</h> <img src= \"dividerImage.png\"> <body>PDF body text here</body>"
Psykie
  • 176
  • 7