You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by "Lakshmikiran.N" <la...@beyontecsolutions.com> on 2015/11/25 20:12:25 UTC
Help me to place an image in pdf using pdfbox
Dear,
I have an issue like placing an Image in a PDF file in a particular location. That location is already water marked.
I’m able to place text there, but unable to place image. This is a similar thread.
http://stackoverflow.com/questions/32223101/text-replace-with-image-in-apache-pdfbox/33923160#33923160
I found some answer like
http://stackoverflow.com/questions/32617343/how-open-and-replace-a-data-from-pdf-stream-in-the-apache-pdfbox-lib-in-java
But I didn’t reach the requirement. Can you please help me.
Regards
N L Kiran
Regards
N L Kiran
9789477523
BEYONTEC 2nABLE SOLUTIONS PRIVATE LIMITED
“ BAHWAN IT PARK” ,2nd Floor, (West Wing), No. 148,
Rajiv Gandhi Salai (OMR), Okkiyyam Thoraipakkam, Chennai – 600 097.
Phone : 044 - 24962426, 27, 28.
www.beyontecsolutions.com
Re: Migrating to 2.0.0
Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,
Just use a .load() method that allows a password, e.g.
load(File,String). There is no need to call openProtection() anymore.
@Maruan - can you include this in the migration guide?
Tilman
Am 26.11.2015 um 13:18 schrieb Chris Bamford:
>
> Hi,
>
> I am looking at migrating from 1.8.8 to 2.0.0 and have been consulting
> the migration guide (http://pdfbox.apache.org/2.0/migration.html).
> So far I have not been able to find the correct API call sequence to
> decrypt a document using a simple password.
>
> This is what I do in 1.8.8:
>
> BufferedInputStream bis = .. // open PDF file
> PDDocument document = PDDocument.load(bis);
> if (document.isEncrypted()) {
> document.openProtection(new StandardDecryptionMaterial(THE_PASSWORD));
> AccessPermission ap = document.getCurrentAccessPermission();
> if (ap == null || ! ap.canExtractContent()) {
> // give up
> }
> }
>
> What is the 2.0.0 equivalent?
> Thanks,
> - Chris
>
>
>
>
>
>
> Chris Bamford m: +44 7860 405292 www.mimecast.com
> <http://www.mimecast.com/>
> Lead Software Engineer p: +44 207 847 8700 Address click here
> <http://www.mimecast.com/About-us/Contact-us/>
> ------------------------------------------------------------------------
> http://www.mimecast.com/
> <https://serviceB.mimecast.com/mimecast/click?account=C1A1&code=2654dc9cd51e36badd01d28d5fa850b4>
>
>
>
>
> LinkedIn
> <https://serviceB.mimecast.com/mimecast/click?account=C1A1&code=101a49facb5a0f2a43552553ac35cccc>
>
>
>
> YouTube
> <https://serviceB.mimecast.com/mimecast/click?account=C1A1&code=d661e8c1e7c5f2b0998b827f60b89a3c>
>
>
>
> Facebook
> <https://serviceB.mimecast.com/mimecast/click?account=C1A1&code=0bc2921f19cb5f10613e4c2261fa6207>
>
>
>
> Blog
> <https://serviceB.mimecast.com/mimecast/click?account=C1A1&code=257e872e041274432a2a6d10150d7b04>
>
>
>
> Twitter
> <https://serviceB.mimecast.com/mimecast/click?account=C1A1&code=18e31f9a532a0688ca8214b25d124fee>
>
>
>
>
> <https://serviceB.mimecast.com/mimecast/click?account=C1A1&code=d8b94b9e882149c90b71cada93d1c073>
>
>
>
> *Disclaimer*
> The information contained in this communication from
> *cbamford@mimecast.com * sent at 2015-11-26 12:18:38 is confidential
> and may be legally privileged. It is intended solely for use by
> *users@pdfbox.apache.org * and others authorized to receive it. If you
> are not *users@pdfbox.apache.org * you are hereby notified that any
> disclosure, copying, distribution or taking action in reliance of the
> contents of this information is strictly prohibited and may be unlawful.
>
> This email message has been scanned for viruses by Mimecast. Mimecast
> delivers a complete managed email solution from a single web based
> platform. For more information please visit http://www.mimecast.com
>
>
>
>
Migrating to 2.0.0
Posted by Chris Bamford <cb...@mimecast.com>.
Hi,
I am looking at migrating from 1.8.8 to 2.0.0 and have been consulting the migration guide (http://pdfbox.apache.org/2.0/migration.html).
So far I have not been able to find the correct API call sequence to decrypt a document using a simple password.
This is what I do in 1.8.8:
BufferedInputStream bis = .. // open PDF file
PDDocument document = PDDocument.load(bis);
if (document.isEncrypted()) {
document.openProtection(new StandardDecryptionMaterial(THE_PASSWORD));
AccessPermission ap = document.getCurrentAccessPermission();
if (ap == null || ! ap.canExtractContent()) {
// give up
}
}
What is the 2.0.0 equivalent?
Thanks,
- Chris
[ YouTube: http://www.youtube.com/user/mimecast#p/u/15/_523kC3lcNQ] [ Twitter: http://twitter.com/mimecast ] [ Our Blog: http://blog.mimecast.com/ ]
Chris Bamford
Lead Software Engineer
c: +44 7860 405292
p: +44 207 847 8700
http://www.mimecast.com
Johannesburg Map
GPS: 26' 05.940" S, 18o 28' 04.278" E
(http://maps.google.com/maps/ms?hl=en&ie=UTF8&msa=0&msid=104153695170153523925.000469102c74a808b138c≪=-26.099685,28.069403&spn=0.011986,0.026178&z=16)
Cape Town Map
GPS: 33o 56.068" S, 18o 28.320" E
(http://maps.google.com/maps/ms?source=s_q&hl=en≥ocode=&mrt=all&ie=UTF8&g=Fir+Street,+Observatory,Cape+Town&msa=0≪=-33.934753,18.4721&spn=0.00413,0.009656&z=17&msid=100887237870528382628.00046a80a3916c933dad3)
====================================================================================================================================================================
Disclaimer
This email, sent at 12:18:38 on 2015-11-26 from cbamford@mimecast.com to users@pdfbox.apache.org has been scanned for viruses and malware by Mimecast, an innovator in software as a service (SaaS) for business. Mimecast Services Ltd's email continuity, security, archiving and compliancy is managed by Mimecast's unified email management platform.
To find out more, email info@mimecast.co.za or request a demo.
Mimecast SA (Pty) Ltd is a registered company within the Republic of South Africa, company registration number: 2004/000965/07 VAT No. 4650210547
Re: Help me to place an image in pdf using pdfbox
Posted by "Lakshmikiran.N" <la...@beyontecsolutions.com>.
Thank you very much Mr. Tilman
Its working.
Regards
Kiran
-----Original Message-----
From: Tilman Hausherr
Sent: Thursday, November 26, 2015 1:07 AM
To: users@pdfbox.apache.org
Subject: Re: Help me to place an image in pdf using pdfbox
Am 25.11.2015 um 20:29 schrieb Lakshmikiran.N:
>
> Can you please help by providing any link or code
download the sources:
http://pdfbox.apache.org/download.cgi
then look at the examples, e.g. AddImageToPDF.java
Tilman
---------------------------------------------------------------------
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
Re: Help me to place an image in pdf using pdfbox
Posted by Tilman Hausherr <TH...@t-online.de>.
Am 25.11.2015 um 20:29 schrieb Lakshmikiran.N:
>
> Can you please help by providing any link or code
download the sources:
http://pdfbox.apache.org/download.cgi
then look at the examples, e.g. AddImageToPDF.java
Tilman
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Help me to place an image in pdf using pdfbox
Posted by "Lakshmikiran.N" <la...@beyontecsolutions.com>.
-----Original Message-----
From: Tilman Hausherr
Sent: Thursday, November 26, 2015 12:56 AM
To: users@pdfbox.apache.org
Subject: Re: Help me to place an image in pdf using pdfbox
Am 25.11.2015 um 20:12 schrieb Lakshmikiran.N:
> Dear,
>
> I have an issue like placing an Image in a PDF file in a particular
> location. That location is already water marked.
> I’m able to place text there, but unable to place image. This is a similar
> thread.
> http://stackoverflow.com/questions/32223101/text-replace-with-image-in-apache-pdfbox/33923160#33923160
See the comment below the question... oops, that was me.
> I found some answer like
> http://stackoverflow.com/questions/32617343/how-open-and-replace-a-data-from-pdf-stream-in-the-apache-pdfbox-lib-in-java
>
> But I didn’t reach the requirement. Can you please help me.
>
How is your requirement different to the ordinary "place image at
specific place"?
Tilman
Can you please help by providing any link or code
Kiran
---------------------------------------------------------------------
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
Re: Help me to place an image in pdf using pdfbox
Posted by Tilman Hausherr <TH...@t-online.de>.
Am 25.11.2015 um 20:12 schrieb Lakshmikiran.N:
> Dear,
>
> I have an issue like placing an Image in a PDF file in a particular location. That location is already water marked.
> I’m able to place text there, but unable to place image. This is a similar thread.
> http://stackoverflow.com/questions/32223101/text-replace-with-image-in-apache-pdfbox/33923160#33923160
See the comment below the question... oops, that was me.
> I found some answer like
> http://stackoverflow.com/questions/32617343/how-open-and-replace-a-data-from-pdf-stream-in-the-apache-pdfbox-lib-in-java
>
> But I didn’t reach the requirement. Can you please help me.
>
How is your requirement different to the ordinary "place image at
specific place"?
Tilman
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org