Path: csiph.com!news.swapon.de!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.040 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'cc:addr:python-list': 0.09; 'command.': 0.09; 'creighton': 0.09; 'python': 0.10; 'output': 0.13; 'def': 0.13; 'subprocess': 0.16; 'laura': 0.18; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'sep': 0.22; 'cc:no real name:2**0': 0.22; 'tried': 0.24; 'header:In- Reply-To:1': 0.24; 'module': 0.25; 'question': 0.27; 'message- id:@mail.gmail.com': 0.27; '+0200,': 0.27; 'convert': 0.29; "i'm": 0.30; 'non': 0.32; 'getting': 0.33; 'run': 0.33; 'url:python': 0.33; "i'll": 0.33; '(for': 0.34; 'file': 0.34; 'received:google.com': 0.35; 'integrate': 0.35; 'but': 0.36; 'url:org': 0.36; 'created': 0.36; 'url:library': 0.36; 'subject:: ': 0.37; 'pdf': 0.37; 'button': 0.38; "didn't": 0.39; 'enough': 0.39; 'easy': 0.60; 'url:3': 0.60; 'save': 0.60; 'your': 0.60; 'more': 0.63; 'card': 0.63; 'url:4': 0.70; '.....': 0.76; 'received:mail-wi0-x229.google.com': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=VLw0PRfcYti99rPTOgp4NGYLO4DtJOj6gDo8QSbs0eQ=; b=Ird8UUPAfgt3k1NdYD+q918eKcca/a7aGVzmW7jSlzb8m6cYFfDiZM93L3AbCku+v3 4Af9VxWGfht1sesgCVkPznYDNiJi74EXUGdkF+iu27fS2jejU2rA/74NJGPmqdiUqHEk 0xaXbme5AIwHjCqO14XXrGQjo0WGEcQ/twvjGpKp9Y6XOIbA5WqU7WPN3rccv563oVRo sX8bQr9msjq9lmgZFxoisrsVGFmk4+ZyAKyQkpern6BZ/XaTevBLSa+oChkJ8tE7iKOt QYwmhQ1TAnZiS2afT1o2bNLyZqfBjWGmrehs4FG+iKQgozkRte7JrdoKxLGENjgHI4wd 6yUQ== X-Received: by 10.194.78.34 with SMTP id y2mr19155496wjw.91.1442783500492; Sun, 20 Sep 2015 14:11:40 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <201509201952.t8KJqh7W029272@fido.openend.se> References: <201509201812.t8KICXHu004041@fido.openend.se> <201509201909.t8KJ93oU018314@fido.openend.se> <201509201952.t8KJqh7W029272@fido.openend.se> From: Baladjy KICHENASSAMY Date: Sun, 20 Sep 2015 23:11:20 +0200 Subject: Re: Postscript to pdf To: Laura Creighton Cc: python-list@python.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Mon, 21 Sep 2015 09:55:25 +0200 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 55 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1442822127 news.xs4all.nl 23762 [2001:888:2000:d::a6]:50100 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:96919 well one more question :/ i tried this def save(): Canevas.update() Canevas.postscript(file=3DtkFileDialog.asksaveasfilename(), colormode=3D'color') subprocess.call(["ps2pdf", "-dEPSCrop", "test.ps", "test.pdf"]) i got the ps file but i didn't get the pdf file :/ 2015-09-20 21:52 GMT+02:00 Laura Creighton : > In a message of Sun, 20 Sep 2015 21:32:34 +0200, Baladjy KICHENASSAMY wri= tes: >>ohhhh ok i got it >>actually it's very easy the commande is : >>ps2pdf -dEPSCrop image.ps >> >>sorry but i'm new to python my last question is how to integrate this >>to python... i want that the output file must be a pdf ? >> >>1) i created a button which i'll save my id card as "ps" file >> >>def save(): >> Canevas.update() >> Canevas.postscript(file=3DtkFileDialog.asksaveasfilename(), colormode= =3D'color') > >>2) so now i want to create a button to convert this "ps" file into "pdf" = .... >> >>def convert(): >> help :/ > > You need to run the subprocess module to run your command. > https://docs.python.org/2/library/subprocess.html (for python 2) > https://docs.python.org/3.4/library/subprocess.html (for python 3) > > is this enough or do you need more help getting it to work? > > Laura > --=20 KICHENASSAMY Baladjy Ing=C3=A9nieur en G=C3=A9nie M=C3=A9canique Sp=C3=A9cialiste Contr=C3=B4le Non Destructif et Qualification des proc=C3= =A9d=C3=A9s sp=C3=A9ciaux COSAC CND Niveau 2 RT et PT Aircelle SAFRAN Tel:06.03.72.53.12