• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSAttributedText initWithHTML: can you preserving html links
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSAttributedText initWithHTML: can you preserving html links


  • Subject: Re: NSAttributedText initWithHTML: can you preserving html links
  • From: minapre999 <email@hidden>
  • Date: Tue, 25 Apr 2006 12:04:09 +1000


I should also mention that I have control over the content of the html pages that I am converting (basically a manual for my app, with a table of contents - I want to convert to pdf with the toc entries hyperlinking to the proper area in the pdf format). I don't know a lot about pdf format, but am thinking that I could maybe alter the html to make the job simpler (eg use of hidden text, wrapping some key pdf words in html comment, etc).


On 24/04/2006, at 10:14 PM, Nicko van Someren wrote:

(even if it did, I'm not sure if saving the text view as pdf would preserve it).

Does anyone know if cocoa can convert html to pdf, and preserve the links?

The only way I can think of doing this, and it's sort of ugly, is to make up the PDF file as you do at the moment and then load it back into an PDFDocument using PKDKit. Then you can extract the text, match up the text against your NSAttributedString, locate the link attributes and then attach PDFAnnotationLink objects to the matching texts. You can then save it back out with the link annotations. It's yucky, but it might work...


	Nicko


Send instant messages to your online friends http://au.messenger.yahoo.com _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >NSAttributedText initWithHTML: can you preserving html links (From: minapre999 <email@hidden>)
 >Re: NSAttributedText initWithHTML: can you preserving html links (From: Nicko van Someren <email@hidden>)

  • Prev by Date: Re: Should Cocoa Apps have splash screens at all ?
  • Next by Date: Re: Getting a machine's MAC address
  • Previous by thread: Re: NSAttributedText initWithHTML: can you preserving html links
  • Next by thread: Cocoa Cube animation framework?
  • Index(es):
    • Date
    • Thread