Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

207
Visualizações
Ghostscript : Filter out image streams by criteria

I have pdf files created on Adobe InDesign, which contains several kinds of object.

I wish to "Remove everything except the largest art (background)" and save to a new file.

This can be achieved almost perfectly with combination of gs command options like this:

$ gs -q -o "${outfile}" -sDEVICE=pdfwrite -dFILTERTEXT -dFILTERVECTOR "${infile}"

However, occasionally there are several raster images which I'd like to filter by some criteria. The image I wish to keep, always have following properties that distinguish it from the unwanted ones:

  • it is always the largest in data size
  • it is always the largest by dimension
  • it is always a 1bit binary images, sometimes compressed with CCITT g4 or LZW

Is there a way to filter certain images by criteria, by using gs command or any other tools perhaps?

This link guided me to using the filter options, but could not work out how I could extend the functionality further: How can I remove all images from a PDF?

The code runs on a Mac/Ubuntu envrironment.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda