Skip to main content
Known Participant
April 19, 2007
Question

PDF export: spread as single page

  • April 19, 2007
  • 4 replies
  • 2977 views
Hi,<br /><br />I'm doing an export of some (or all) pages of a document to a PDF file.<br />There is an option to put each InDesign spread to a single PDF page, but unfortunately it doesn't work.<br /><br />My code:<br />InterfacePtr<ICommand> piPDFExportCmd(CmdUtils::CreateCommand(kPDFExportCmdBoss));<br /><br />InterfacePtr<IPDFExportPrefs> piPDFExportPrefs(piPDFExportCmd, UseDefaultIID());<br />piPDFExportPrefs->SetPDFExReaderSpreads(printSpreads);<br />piPDFExportPrefs->SetPDFExCompressColorImages(pdfKomprimierung);<br />piPDFExportPrefs->SetPDFExColorSpace(pdfFarbraum);<br /><br />InterfacePtr<ISysFileData> piFileData(piPDFExportCmd, UseDefaultIID());<br />piFileData->Set(pdfFile);<br />UIDList pageUIDList(documentUIDRef.GetDataBase());<br />for (int32 i = vonSeite; i < bisSeite; i++)<br />{<br /> UID uidPage = pageList->GetNthPageUID(i);<br /> pageUIDList.Append(uidPage);<br />}<br />InterfacePtr<IOutputPages> piOutputPages(piPDFExportCmd, UseDefaultIID());<br />piOutputPages->InitializeFrom(pageUIDList, kFalse);<br />CmdUtils::ProcessCommand(piPDFExportCmd);<br /><br />It is the "SetPDFExReaderSpreads" that does not take any effect on the created PDF file, there is always a single PDF page for each InDesign page.<br />If doing the export manually within InDesign it works correct.<br />Any ideas what I'm doing wrong here ?<br /><br />Thanks, Daniel
This topic has been closed for replies.

4 replies

Known Participant
April 19, 2007
Hi all,

Emanuele pointed me to the right direction.
My code was ok except of one point:

piOutputPages->InitializeFrom(pageUIDList, kFalse);

kFalse means: each InDesign page => one PDF page
kTrue means: each InDesign spread => one PDF page (without pasteboard)

You don't have to pass in the UID of the spreads, but always the UID of the pages.
Only use the spreads UIDs if you want to get the pasteboard exported into your PDF, too.

Hoping this can be useful, and thanks to Emanuele, Daniel
Participating Frequently
April 19, 2007
Hi Daniel,
you could try with IOutputPages::SetNthBounds; with this method probably you can override the bounds of each page in your PDF with some given bounds (in your case, you could try with the spread bounds).

Hope this works, I never tried it.

Emanuele.
Known Participant
April 19, 2007
Hi Emanuele,

thanks for your suggestion, it works so far as it shows one spread on each PDF page.
There is one problem left: now it shows the whole spread including the pasteboard, which I don't want to be shown. So the PDF page should only show the pages of the spread without the pasteboard around them.

Daniel
Participating Frequently
April 19, 2007
Hi Daniel.
I would suggest you to try to use IOutputPages::InitializeFrom() with a list of spreads instead of a list of pages as first argument, and with kTrue instead of kFalse as second argument. As far as I've understood you want to export each spread of the doc to one page of the PDF, and this should be the way.

HTH,
Emanuele.