pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Starting question about PDFBox
Date Thu, 14 Apr 2016 16:24:29 GMT
Am 14.04.2016 um 11:06 schrieb Macamba:
> Thanks for the feedback. (Is it appreciated when you thank someone?)

Yes of course :-)


>
> As far as I know, the site I mentioned is the only site which has some
> explaining about PDFBox. It was helpful that it pressured me to become
> member of this mailing list, ask a question, and be pointed to the SVG
> website
> (https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apach
> e/pdfbox/examples/).


There are also many examples on stackoverflow, and there are several 
people who help. The only downside of stackoverflow is that some 
examples apply to 1.8 only, but this is mostly about how to open a file.

If you can't find what you need, just ask there or here.

Tilman


>
> Michel
>
> -----Original Message-----
> From: Tilman Hausherr [mailto:THausherr@t-online.de]
> Sent: dinsdag 12 april 2016 18:41
> To: users@pdfbox.apache.org
> Subject: Re: Starting question about PDFBox
>
> Am 12.04.2016 um 14:56 schrieb BREMAUD, CYRIL:
>> Hi,
>> You can find many example with PDFBox 2.0.0 at this link :
>> https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/
>> apache/pdfbox/examples/
> Indeed, the examples from the source code downloads are the best way to
> start.
>
> That site is not really helpful. I've put a comment there three days ago and
> it is still in moderation.
> http://radixcode.com/pdfbox-example-code-how-to-extract-text-from-pdf-file-w
> ith-java/
>
> The only good side of this is that this increases my score on stackoverflow
> :-)
>
> Tilman
>
>
>
>> BR
>> Cyril.
>>
>> -----Original Message-----
>> From: Macamba [mailto:macamba@hermod.nl]
>> Sent: Tuesday, April 12, 2016 2:15 PM
>> To: users@pdfbox.apache.org
>> Subject: Starting question about PDFBox
>>
>> Hi,
>>
>>    
>>
>> My apologies for this basic question, but I'm just starting with
>> PDFBox and can't make heads nor tale from it (at the moment). I found
>> a website
>> (http://radixcode.com/category/pdfbox/) which had example code I wanted to
> start out with. But when I copied the first code into Eclipse my Eclipse
> complained about some of the imports. I have included the example code below
> my text.
>>    
>>
>> As I start with PDFBox I need some documentation to help me start. As I
> use PDFBox 2.0.0 I cannot find any examples. Does anyone know of websites
> with some explanation? Or would it be smarter to use PDFBox 1.8.11 (which
> also has no example of a working example as far as I could see)?
>>    
>>
>> Thanks,
>>
>> Macamba
>>
>>    
>>
>> Example code from http://radixcode.com/category/pdfbox/
>>
>>    
>>
>> import java.io.FileInputStream;
>>
>> import org.apache.pdfbox.pdmodel.PDDocument;
>>
>> import org.apache.pdfbox.pdmodel.PDPage;
>>
>> import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;
>>
>> // The following import org.apache.pdfbox.pdmodel.graphics.xobject
>> cannot be resolved
>>
>> import org.apache.pdfbox.pdmodel.graphics.xobject.PDJpeg;
>>
>> // The following import org.apache.pdfbox.pdmodel.graphics.xobject
>> cannot be resolved
>>
>> import org.apache.pdfbox.pdmodel.graphics.xobject.PDXObjectImage;
>>
>>    
>>
>> /**
>>
>> *
>>
>> * @author azeem
>>
>> */
>>
>>    
>>
>> public class Main {
>>
>>    
>>
>>       public static void main(String[] args) {
>>
>>    
>>
>>           String fileName = "pdfWithImage.pdf";
>>
>>           String imageName = "Logo.jpg";
>>
>>    
>>
>>           try {
>>
>>    
>>
>>               PDDocument doc = new PDDocument();
>>
>>               PDPage page = new PDPage();
>>
>>    
>>
>>               doc.addPage(page);
>>
>>    
>>
>>               PDXObjectImage image = new PDJpeg(doc, new
>> FileInputStream(imageName));
>>
>>    
>>
>>               PDPageContentStream content = new
>> PDPageContentStream(doc, page);
>>
>>    
>>
>>               content.drawImage(image, 180, 700);
>>
>>    
>>
>>               content.close();
>>
>>    
>>
>>               doc.save(fileName);
>>
>>    
>>
>>               doc.close();
>>
>>    
>>
>>           } catch (Exception e) {
>>
>>               System.err.println(e.getMessage());
>>
>>           }
>>
>>       }
>>
>> }
>>
>>    
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message