2

I need to create a PDF file on the console in the format

  • 300 DPI
  • PDF-VERSION: PDF/X-1a:2001
  • Colors: Coated Fogra 39

I use python to take a screenshot in 5 dpi from a ZeroNet site with selenium:


options = Options()
options.headless = True
profile = webdriver.FirefoxProfile("/home/ruben/.mozilla/firefox/akp96vh9.bookmarks")
profile.set_preference("layout.css.devPixelsPerPx", 5) # DPI
driver = webdriver.Firefox(options=options, firefox_profile=profile)
driver.get(some_site)
WebDriverWait(driver, 10).until(
    EC.presence_of_element_located((By.XPATH, '//*[@id="inner-iframe"]'))
)
zero_frame = driver.find_element_by_xpath('//*[@id="inner-iframe"]')
driver.switch_to.frame(zero_frame)
time.sleep(5)
cards = driver.find_element_by_id("overlay");
cards.location_once_scrolled_into_view
cards.screenshot("screenshot.png")

This creates a screenshot that I convert to PDF with:

convert -profile sRGB.icc -profile CoatedFOGRA39.icc -units PixelsPerInch -density 300  -resize 7016x9922 screenshot.png final_print.dpf

But this creates a PDF with Version 1.7 with transparency

How can I convert it into PDF-VERSION: PDF/X-1a:2001 on linux?

rubo77
  • 34,024
  • 52
  • 172
  • 299

1 Answers1

0

I can't comment yet due to reputation, so I'll have to post this non-answer as an answer. You can install Scribus ( >= 1.5.1) and run scripts from the command line. You'd have to write a script that takes as input your original PDF file and converts it to your required standard.

Cornul11
  • 168
  • 7