Author Topic: How to automate/simplify process - Import PDF -> Apply properties -> Export  (Read 1469 times)

August 18, 2017, 01:04:45 AM
Read 1469 times

Greg

  • Sr. Newbie

  • Offline
  • **

  • 2
First of all let me say hello :)

I know that questions about automating different processes in Inkscape are probably as old as this forum, but will try it any way as I'm in a bit of a (time related) pickle.

I have large number of PDFs (exported from AutoCAD) with floor layouts which I need to process as follows:
1. Import to new/existing layer in Inkscape - matching names of PDF and layer to simplify the process
2. Resize - 1000px height, width proportional
3. Place in centre - horizontally and vertically
4. Export along with 1 or 2 different layers (already created) to *.png - FHD, 96DPI

The rest of customisation I will probably be able to figure out by myself, but beginning is always the hardest.
Doing it once I could probably manage by simple clicking - but original CAD files change once a week and I have to do it again, and again. So I will be really grateful for any suggestions how to simplify this Sisyphean labour.

With best regards
G.

August 18, 2017, 04:45:13 PM
Reply #1

brynn

  • Administrator

  • Offline
  • ******

  • 3,941
  • Gender
    Female

    Female
    • Inkscape Community
Welcome to the forum!

Yes a script and/or Inkscape's command line feature could probably do this.  Unfortunately, personally, I don't know how to either write scripts or use the command line.

Do you know any kind of scripting?

If not, I would suggest posting on the User Community mailing list.  The people who typically participate there are advanced users and developers (oh yeah, plenty of newbies too) who are capable, and might either give you the code, or help you create it on your own.  https://inkscape.org/en/community/mailing-lists/

Another thing to consider is writing your own extension, since you'll be doing this often.  Probably there are existing extensions which already perform parts of the steps you need.  So by studying them, you could either learn how to write parts of the extension, or even use them outright, if their license permits it.  Any extensions which are packed with Inkscape are "fair game" for copying part of the code, because of Inkscape's license.  But if you find any that were made for personal use, and not packed with Inkscape, you should be sure and look for a license.  Info on writing an extension:  https://inkscape.org/en/develop/extensions/
  • Inkscape version 0.92.3
  • Windows 7 Pro, 64-bit
Inkscape Tutorials (and manuals)                      Inkscape Community Gallery                        Inkscape for Cutting Design                     



"Be ashamed to die until you have won some victory for humanity" - Horace Mann                       

August 19, 2017, 02:37:55 AM
Reply #2

Greg

  • Sr. Newbie

  • Offline
  • **

  • 2
Thank you for those suggestions.
I will definitely reach for some more help on mailing list, but as I'm familiar with C++, Java, C# and Python, creating my own extension sounds like the best option.

Will post my results if I decide to go for it ;)