• 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
Generating a paginated PDF for use with PDFDocument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Generating a paginated PDF for use with PDFDocument


  • Subject: Generating a paginated PDF for use with PDFDocument
  • From: Keith Blount <email@hidden>
  • Date: Wed, 12 Sep 2007 11:03:28 -0700 (PDT)

Hi,

I've searched the archives but solutions posted here
don't seem to have worked for me.

Basically, I have a paginated view, a bit like the
multiple page view in text edit, except that mine is
used only for printing. This view gets printed or
saved as a PDF through the inbuilt print panels/sheets
perfectly.

However, what I would now like to do is generate PDF
data from this view that can be used to create a
PDFDocument (using PDFDocument's -initWithData:) and
then displayed in the PDFView right inside my app. In
other words, I want to create a sort of one-click
preview of the paginated view right within in my app,
without having to go to print > preview and without
having to save the PDF to disk.

Unfortunately, all of the methods I have tried to do
this just create one long PDF page rather than a
paginated document with borders.

For instance, I thought this would work:

KBTextPagePrintingView *printView = [self
draftPrintingView];
NSMutableData *data = [NSMutableData data];
NSPrintOperation *printOp = [NSPrintOperation
PDFOperationWithView:printView insideRect:[printView
bounds] toData:data printInfo:[printView printInfo]];
[printOp runOperation];

(Note that KBTextPagePrintingView is my paginated
view.)

But it doesn't. (Neither does NSView's
dataWithPDFInsideRect:) When loaded into a PDFDocument
and then displayed in a PDFView, the document is one
long (and thin) document.

Is there any way of doing this without having to save
the file as a PDF file to disk first?

Many thanks in advance,
Keith



____________________________________________________________________________________
Got a little couch potato?
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Generating a paginated PDF for use with PDFDocument
      • From: John Calhoun <email@hidden>
  • Prev by Date: Problem with bindings/tableView/NSImageCell
  • Next by Date: NSBrowser background color
  • Previous by thread: Re: Problem with bindings/tableView/NSImageCell
  • Next by thread: Re: Generating a paginated PDF for use with PDFDocument
  • Index(es):
    • Date
    • Thread