What is the best approach for creating a high quality PDF from XML?

I am looking to create a high quality PDF file from an XML source, as a result of creating an online photo book creation tool. There are literally hundreds of options for accomplishing this task, from manually creating PDFs (iText, PdfSharp, etc.) to PrinceXML to xsl-fo tools. Here are some of the features that I would like to support:

Mandatory Support

  • Full PDF files
  • Composition of a multi-page
  • Support for dust collectors, spine printing, full cover art + text graphics.
  • Custom page sizes
  • Overlapping graphic elements
  • Custom fonts
  • Cross-folder layout support - double page spread
  • 300-600 dpi image support
  • True WYSIWYG / reliable, predictable output (i.e. perfect pixel conversion from source material to PDF)
  • Margin control
  • Insert color profile
  • Unicode Support
  • Absolutely placed layout elements

Additional support

  • Relative Layout Elements
  • Images (CMYK, RGB)
  • HTTP Fonts
  • Hyphenation support.
  • Support for crop marks.
  • Footnotes
  • Spot Fill Color
  • Tabular Data Support
  • Dialing support (Leading, Kerning, etc.)

If anyone knows how to do this, I would be very grateful. Also, if anyone knows what other online photo books (such as Blurb or Shutterfly) use to convert an online book into a print-ready PDF file, I would be very interested to know.

+6
source share
2 answers

You should look into PrinceXML (what name do you indicate in your question, but don’t tell us that you didn’t like it), which I mentioned here a few days ago - even with screenshots showing the results. Other examples of the prince's output can also be seen.

However, what you mean by “true WYSIWYG” remains rather obscure to me.

Because you need to show me the XML visualizer first ... the one that displays your XML to me on the screen just as you expect your PDF pages to look.


Update: Here is a set of examples for PDF files created by PrinceXML. You can download 14 of them using this command on Linux or Mac OS X:

for i in 9-02 9-01 8-12 8-11 8-10 8-09 8-08 8-07 8-06 8-05 8-04 8-03 8-02 8-01; do wget \ -r \ -t 3 \ -l 1 \ -c \ -O AdvancedAquarist-200${i}.pdf \ http://www.advancedaquarist.com/pdf/AdvancedAquarist-200${i}.pdf/at_download/file done 

On Windows:

 for %i in (9-02 9-01 8-12 8-11 8-10 8-09 8-08 8-07 8-06 8-05 8-04 8-03 8-02 8-01) do ^ wget.exe ^ -r ^ -t 3 ^ -l 1 ^ -c ^ -O AdvancedAquarist-200%i.pdf ^ http://www.advancedaquarist.com/pdf/AdvancedAquarist-200%i.pdf/at_download/file 

IMHO, rather complex layouts are presented here.

Please note that old issues of this magazine until May 2008 were created with iText 1.4.6 (in accordance with their metadata).

New releases starting in June 2008 were mainly performed using PrinceXML 6.0 (which is an issue from 4 years ago ...).

However, both applications created a very similar layout ...

+3
source

You need to translate XML into HTML / XHTML, style it as you want , and in a suitable browser go to File> Print and with the correct driver settings , you can print to PDF.

Waiting for magic direct conversion is a big question :-)

-1
source

Source: https://habr.com/ru/post/892972/


All Articles