0

Kindle Direct Publishing AKA Create Space, wants a PDF/X-1a in 6x9 format with 0.25" outside margins and 0.375" inside/gutter margins, which I need help with, since Qt PDF generator does not do inside and out, so I have to set them both for the largest, and I need to know if my css effects this, if so how, but setting --margin-left .375in --margin-right .375in gives me this error: Currently all margin units must be the same, not sure what that means, why have a left and right if they must both be the same, and does this really have to apply to top and bottom, what is the thinking, so I added it to top and bottom just to make the file, but it is not what I wanted for margins, I wonder if gs can fix this? If so how.

I know that wkhtmltopdf currently only creates PDF version 1.4, and Kindle does not seem to mind that much on upload, I do not have a published upload yet, so I hope someone has and knows this from experience, because I do not know if they will accept that yet, so I also use Ghost Script to convert that to PDF version 1.7, this is what I have currently: PDF_Combine is a bash array of files: PDF_Combine=("file1.html" "file2.html");

Update: Now KDP wants .875in margins, on both sides my content is real small, how dose CSS effect Margins in a PDF, can I set the Margins to 0 in wkhtmltopdf and adjust them in my CSS, if so how, in the body?

wkhtmltopdf --margin-left .375in --margin-right .375in --margin-bottom .375in --margin-top .375in --page-width 6in --page-height 9in --load-error-handling ignore --javascript-delay 3333 --enable-forms --footer-center "[page]/[topage]" "${PDF_Combine[@]}" "/MyPath/MyFileName.pdf"

The Ghost Script:

gs -dPDFA -dBATCH -dNOPAUSE -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -sPDFACompatibilityPolicy=1 -sOutputFile="/MyPath/MyOutPutFileName.pdf" "/MyPath/MyInPutFileName.pdf"
user83395
  • 103
  • 1
  • 8

1 Answers1

0

PDF/X-1a is a highly specific restricted set of PDF features; for instance you cannot use the RGB colour model when producing a PDF/X-1a

You also need specific keys to be present in the Info dictionary of the PDF file.

Ghostscript does not create PDF/X-1a files. It can create PDF/X-3 files, but that's no good to you.

You can process a PDF file using Ghostscript to add white space around the page, what you need to do is specify a larger media size, and tell Ghostscript its a fixed size, so the PDF file can't change it. Then you need to offset the content up and right on the new media (because otherwise the content will be rendered in the bottom left corner). Note; its not clear to me if you want to increase the media size, or reduce the content so that it fits into the required media, but has margins.

See the answer and comments on the question here.

KenS
  • 30,202
  • 3
  • 34
  • 51
  • My problem is the inside Margins are too small, so the text goes off page, and the outside are too big, so I have wasted paper, but the content looks fine so far. Also note that I have uploaded the PDF version 1.4 and KDP has not complained about that. – user83395 Feb 16 '19 at 18:12
  • Then maybe Amazon are happy with simply PDF 1.4. It sounds like you need to scale the page content down at the same time as adding margins, the question I pointed to above does both of those. Obviously you'll need to adjust the numbers for your requirements. – KenS Feb 16 '19 at 19:55