Return-Path: Delivered-To: apmail-pdfbox-users-archive@www.apache.org Received: (qmail 61927 invoked from network); 5 Nov 2010 22:25:38 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Nov 2010 22:25:38 -0000 Received: (qmail 58867 invoked by uid 500); 5 Nov 2010 22:26:09 -0000 Delivered-To: apmail-pdfbox-users-archive@pdfbox.apache.org Received: (qmail 58795 invoked by uid 500); 5 Nov 2010 22:26:09 -0000 Mailing-List: contact users-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@pdfbox.apache.org Delivered-To: mailing list users@pdfbox.apache.org Received: (qmail 58787 invoked by uid 99); 5 Nov 2010 22:26:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Nov 2010 22:26:09 +0000 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=FREEMAIL_FROM,HTML_FONT_FACE_BAD,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of modsiw.vchante@gmail.com designates 209.85.161.48 as permitted sender) Received: from [209.85.161.48] (HELO mail-fx0-f48.google.com) (209.85.161.48) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Nov 2010 22:26:01 +0000 Received: by fxm7 with SMTP id 7so2835199fxm.21 for ; Fri, 05 Nov 2010 15:25:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:reply-to:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type; bh=BiYIKzsnXOrXqvoEPb9XnSswqRdVjpWC2jNVpvCoT6Q=; b=XcdpjhmEIPa7waPGRu5wuJpmN/mH5OD1UIgf5BSjF8CR7cOYkGUxlLkvU17h/gSDZf tJYGu19EvYP24uVLUxX37PrSblDpjfPYoYZwGoVcsADFBfVu8dnXR2/tVPqHDPbNjnTR 9+Wx4gZwLJVFEizm/wjMrRW9RqNgxksFhKZnA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=Z1Qm1t7jvszr5gkFwtvPnpXBaVCnUOeG9Yd5ciA+ktrz0doGCTPFPe2Bdr7umWfMs0 qiO18rAWvO8o01p+ABS12884Q3eZVyXSVXt9dI6N0VTPtjUOd0Ny7ThnD8yMTLr96U+L PJa2jvT9Aa26OWERLQz2vEiLCUZ5vbDC8H2Ps= Received: by 10.223.97.10 with SMTP id j10mr1442109fan.112.1288995941593; Fri, 05 Nov 2010 15:25:41 -0700 (PDT) MIME-Version: 1.0 Sender: modsiw.vchante@gmail.com Reply-To: grant@floorsoft.com Received: by 10.223.109.16 with HTTP; Fri, 5 Nov 2010 15:25:21 -0700 (PDT) In-Reply-To: References: From: Grant Overby Date: Fri, 5 Nov 2010 18:25:21 -0400 X-Google-Sender-Auth: tp6CV-sJlNgnPL-T_pKmtcWVxIg Message-ID: Subject: Re: Save URLs to PDFs? To: Yogesh Cc: users@pdfbox.apache.org Content-Type: multipart/alternative; boundary=20cf30433f143731a7049455c18b X-Virus-Checked: Checked by ClamAV on apache.org --20cf30433f143731a7049455c18b Content-Type: text/plain; charset=ISO-8859-1 If you download the file through a browser? Does it work then? -- Grant Overby Senior Developer FloorSoft, Inc. Often people, especially computer engineers, focus on the machines. They think, "By doing this, the machine will run faster. By doing this, the machine will run more effectively. By doing this, the machine will something something something." They are focusing on machines. But in fact we need to focus on humans, on how humans care about doing programming or operating the application of the machines. We are the masters. They are the slaves. -- Yukihiro Matsumoto On Fri, Nov 5, 2010 at 6:18 PM, Yogesh wrote: > I tried with that, it writes a blank PDF. Though, the file size and the > number of pages is correct (for the new written file) > > - Yogesh > > > > > On 5 November 2010 18:09, Grant Overby wrote: > >> You don't need pdfBox to do this. Below is some rough code that allows you >> to download a file and save it. >> >> URLConnection urlConnection = new URL("http://..."); >> InputStream in = urlConnection.getInputStream(); >> FileWriter out = new FileWriter("my.pdf"); >> int next = 0; >> while ( ( next = in.read() ) != -1 ) out.write(next); >> //close everything >> >> -- >> Grant Overby >> Senior Developer >> FloorSoft, Inc. >> >> Often people, especially computer engineers, focus on the machines. They >> think, "By doing this, the machine will run faster. By doing this, the >> machine will run more effectively. By doing this, the machine will >> something >> something something." They are focusing on machines. But in fact we need >> to >> focus on humans, on how humans care about doing programming or operating >> the >> application of the machines. We are the masters. They are the slaves. -- >> Yukihiro Matsumoto >> >> >> >> >> On Fri, Nov 5, 2010 at 5:56 PM, Yogesh wrote: >> >> > Hi, >> > >> > I have PDFs which I can access through URLs. I want to download and save >> it >> > to files. How can I go about it? >> > >> > Thanks >> > >> > -Yogesh >> > >> > > --20cf30433f143731a7049455c18b--