Discussion:
[iText-questions] Still able to copy text under stamp.
Ryan Moser
2009-02-19 22:20:45 UTC
Permalink
I'm trying to apply a stamp to pdf documents in order to make the text under not visable (or able to copy) for a preview. I have no problem applying the stamp to the documents. The problem is with the pdf docs that you are able to copy the text (ie. all non-scanned pdfs) you can just copy the text from under the stamp and use it in any text editor. I've tried a bunch of different stamps and backgrounds without any luck.

If any examples are needed i have plenty. They are legal motions so some are scanned and some are pdf from .doc. Those are the ones I'm having trouble with.

Thanks for any help.

ryan
Leonard Rosenthol
2009-02-20 02:09:25 UTC
Permalink
If what you are trying to accomplish is redaction, you are going about it ALL WRONG!

-----Original Message-----
From: Ryan Moser [mailto:***@whack.org]
Sent: Thursday, February 19, 2009 5:21 PM
To: itext-***@lists.sourceforge.net
Subject: [iText-questions] Still able to copy text under stamp.

I'm trying to apply a stamp to pdf documents in order to make the text under not visable (or able to copy) for a preview. I have no problem applying the stamp to the documents. The problem is with the pdf docs that you are able to copy the text (ie. all non-scanned pdfs) you can just copy the text from under the stamp and use it in any text editor. I've tried a bunch of different stamps and backgrounds without any luck.

If any examples are needed i have plenty. They are legal motions so some are scanned and some are pdf from .doc. Those are the ones I'm having trouble with.

Thanks for any help.

ryan

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
iText-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Ryan Moser
2009-02-20 06:12:06 UTC
Permalink
Thanks for the reply. I'll try to clear up what i need to do and hopefully you can steer me in the right direciton.

I guess it is technically readaction, but its a fixed area of the page for all the documents i input. I just want the botton 2/3rd's of the page redacted then add a stamp on top of that with the company name.

I've tried Graphicsmagick to distort the botton 2/3rd's of the page, but it is just too slow and resulting file size to big for what i need. Thanks for any help

ryan
Post by Leonard Rosenthol
If what you are trying to accomplish is redaction, you are going about it ALL WRONG!
-----Original Message-----
Sent: Thursday, February 19, 2009 5:21 PM
Subject: [iText-questions] Still able to copy text under stamp.
I'm trying to apply a stamp to pdf documents in order to make the text under not visable (or able to copy) for a preview. I have no problem applying the stamp to the documents. The problem is with the pdf docs that you are able to copy the text (ie. all non-scanned pdfs) you can just copy the text from under the stamp and use it in any text editor. I've tried a bunch of different stamps and backgrounds without any luck.
If any examples are needed i have plenty. They are legal motions so some are scanned and some are pdf from .doc. Those are the ones I'm having trouble with.
Thanks for any help.
ryan
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
1T3XT info
2009-02-20 07:29:12 UTC
Permalink
I'll try to clear up what i need to do and hopefully you can steer me in the right direction.
Your requirement is still not clear.

You want to cover 2/3 of a page with a blank rectangle?
That's possible.

But: if the covered text isn't a scanned image,
people will be able to copy/paste the text,
unless you encrypt the file and disallow copying
(in that case, people also won't be able to copy/paste
the text in the upper 1/3 of the page).

Note that this kind of requirement is rather absurd,
because the "protection" is only psychological.
The "hidden" text will always remain there.
If you work for a legal institute as a contractor and
you fool the customer into believing this is a safe solution,
you're bound to get in trouble.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
Ryan Moser
2009-02-20 16:36:43 UTC
Permalink
As it is right now. Someone uploads a document and openoffice is converting them to .pdf (with jodconverter). Some of the files are uploaded as .pdf both scanned and pdf created with Acrobat. I'm trying to have my servelet make a "preview" of the all the pdf's. Right now I'm just stamping a logo over the bottom 2/3rd's of the page with a message "Preview only shows 1/3rd of each page. Please purchase to view entire document". This is not working because of copying under the stamp for the non scanned pdfs.

I've tried to encrypt the docs to disallow everything that I can, but my reader (Document Viewer 2.24.1 Ubuntu 8.10) doesn't seem to respect that and I can still copy and paste just fine.

I really don't want to go back to the slowness and huge file sizes associated with Graphicsmagick (not to mention Imagemagick!), but being 100% open source it looks like that may be my only option.

Thanks for your time and help with this.
Post by 1T3XT info
I'll try to clear up what i need to do and hopefully you can steer me in the right direction.
Your requirement is still not clear.
You want to cover 2/3 of a page with a blank rectangle?
That's possible.
But: if the covered text isn't a scanned image,
people will be able to copy/paste the text,
unless you encrypt the file and disallow copying
(in that case, people also won't be able to copy/paste
the text in the upper 1/3 of the page).
Note that this kind of requirement is rather absurd,
because the "protection" is only psychological.
The "hidden" text will always remain there.
If you work for a legal institute as a contractor and
you fool the customer into believing this is a safe solution,
you're bound to get in trouble.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
1T3XT info
2009-02-20 16:51:52 UTC
Permalink
Post by Ryan Moser
This is not working because of copying under the stamp for the non scanned pdfs.
That's correct: covering the content doesn't mean you can't select the text.
Post by Ryan Moser
I've tried to encrypt the docs to disallow everything that I can, but my reader (Document Viewer 2.24.1 Ubuntu 8.10) doesn't seem to respect that and I can still copy and paste just fine.
I know, some viewers don't respect the permissions.
Post by Ryan Moser
Post by 1T3XT info
because the "protection" is only psychological.
The "hidden" text will always remain there.
If you work for a legal institute as a contractor and
you fool the customer into believing this is a safe solution,
you're bound to get in trouble.
Thanks for your time and help with this.
If you want to make a preview, your best shot is to rasterize the PDF
and to cut 2 thirds of the image. I'm pretty sure JPedal or PDF Renderer
can do the trick.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
1T3XT info
2009-02-20 16:55:02 UTC
Permalink
Post by Ryan Moser
This is not working because of copying under the stamp for the non scanned pdfs.
If you want some fun, read:
http://www.planetpdf.com/enterprise/article.asp?ContentID=7049
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
Leonard Rosenthol
2009-02-20 16:57:10 UTC
Permalink
GM and IM are slow rasterizing PDFs for two reasons - one, they use Ghostscript and two, they usually do it at higher resolutions than you might normally like/need.

I would look, as Bruno suggested, at a native PDF renderer such as JPEDAL and specify a LOW resolution (say 72 dpi, since it's only for screen viewing).

Leonard

-----Original Message-----
From: Ryan Moser [mailto:***@whack.org]
Sent: Friday, February 20, 2009 11:37 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Still able to copy text under stamp.

As it is right now. Someone uploads a document and openoffice is converting them to .pdf (with jodconverter). Some of the files are uploaded as .pdf both scanned and pdf created with Acrobat. I'm trying to have my servelet make a "preview" of the all the pdf's. Right now I'm just stamping a logo over the bottom 2/3rd's of the page with a message "Preview only shows 1/3rd of each page. Please purchase to view entire document". This is not working because of copying under the stamp for the non scanned pdfs.


I've tried to encrypt the docs to disallow everything that I can, but my reader (Document Viewer 2.24.1 Ubuntu 8.10) doesn't seem to respect that and I can still copy and paste just fine.

I really don't want to go back to the slowness and huge file sizes associated with Graphicsmagick (not to mention Imagemagick!), but being 100% open source it looks like that may be my only option.

Thanks for your time and help with this.
Post by 1T3XT info
I'll try to clear up what i need to do and hopefully you can steer me in the right direction.
Your requirement is still not clear.
You want to cover 2/3 of a page with a blank rectangle?
That's possible.
But: if the covered text isn't a scanned image,
people will be able to copy/paste the text,
unless you encrypt the file and disallow copying
(in that case, people also won't be able to copy/paste
the text in the upper 1/3 of the page).
Note that this kind of requirement is rather absurd,
because the "protection" is only psychological.
The "hidden" text will always remain there.
If you work for a legal institute as a contractor and
you fool the customer into believing this is a safe solution,
you're bound to get in trouble.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
iText-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Leonard Rosenthol
2009-02-20 11:33:50 UTC
Permalink
The only way to redact is to do what the term actually means - EDIT...

You will need to do VERY LOW LEVEL operations on the PDF to determine what objects lie inside the area you are interested in, and then remove them from the PDF, without impact the visual positioning of any other object on the page.

This is a MAJOR project - even given a PDF library that has all the necessary components (which iText does not). I would give yourself at least 6-9 months for development...

Leonard

-----Original Message-----
From: Ryan Moser [mailto:***@whack.org]
Sent: Friday, February 20, 2009 1:12 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Still able to copy text under stamp.

Thanks for the reply. I'll try to clear up what i need to do and hopefully you can steer me in the right direciton.

I guess it is technically readaction, but its a fixed area of the page for all the documents i input. I just want the botton 2/3rd's of the page redacted then add a stamp on top of that with the company name.

I've tried Graphicsmagick to distort the botton 2/3rd's of the page, but it is just too slow and resulting file size to big for what i need. Thanks for any help

ryan
Post by Leonard Rosenthol
If what you are trying to accomplish is redaction, you are going about it ALL WRONG!
-----Original Message-----
Sent: Thursday, February 19, 2009 5:21 PM
Subject: [iText-questions] Still able to copy text under stamp.
I'm trying to apply a stamp to pdf documents in order to make the text under not visable (or able to copy) for a preview. I have no problem applying the stamp to the documents. The problem is with the pdf docs that you are able to copy the text (ie. all non-scanned pdfs) you can just copy the text from under the stamp and use it in any text editor. I've tried a bunch of different stamps and backgrounds without any luck.
If any examples are needed i have plenty. They are legal motions so some are scanned and some are pdf from .doc. Those are the ones I'm having trouble with.
Thanks for any help.
ryan
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
iText-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Leonard Rosenthol
2009-02-20 14:16:10 UTC
Permalink
I should add that there are already commercial solutions available to you for both desktop and server-based redaction of PDFs...

Leonard

-----Original Message-----
From: Leonard Rosenthol [mailto:***@adobe.com]
Sent: Friday, February 20, 2009 6:34 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Still able to copy text under stamp.

The only way to redact is to do what the term actually means - EDIT...

You will need to do VERY LOW LEVEL operations on the PDF to determine what objects lie inside the area you are interested in, and then remove them from the PDF, without impact the visual positioning of any other object on the page.

This is a MAJOR project - even given a PDF library that has all the necessary components (which iText does not). I would give yourself at least 6-9 months for development...

Leonard

-----Original Message-----
From: Ryan Moser [mailto:***@whack.org]
Sent: Friday, February 20, 2009 1:12 AM
To: Post all your questions about iText here
Subject: Re: [iText-questions] Still able to copy text under stamp.

Thanks for the reply. I'll try to clear up what i need to do and hopefully you can steer me in the right direciton.

I guess it is technically readaction, but its a fixed area of the page for all the documents i input. I just want the botton 2/3rd's of the page redacted then add a stamp on top of that with the company name.

I've tried Graphicsmagick to distort the botton 2/3rd's of the page, but it is just too slow and resulting file size to big for what i need. Thanks for any help

ryan
Post by Leonard Rosenthol
If what you are trying to accomplish is redaction, you are going about it ALL WRONG!
-----Original Message-----
Sent: Thursday, February 19, 2009 5:21 PM
Subject: [iText-questions] Still able to copy text under stamp.
I'm trying to apply a stamp to pdf documents in order to make the text under not visable (or able to copy) for a preview. I have no problem applying the stamp to the documents. The problem is with the pdf docs that you are able to copy the text (ie. all non-scanned pdfs) you can just copy the text from under the stamp and use it in any text editor. I've tried a bunch of different stamps and backgrounds without any luck.
If any examples are needed i have plenty. They are legal motions so some are scanned and some are pdf from .doc. Those are the ones I'm having trouble with.
Thanks for any help.
ryan
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
iText-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
iText-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Cool The Breezer
2009-02-20 09:10:50 UTC
Permalink
https://svgsalamander.dev.java.net/
Can we use this for commercial purpose? As per its license, its covered under LGPL and I am not sure whether commercially it can be used without purchasing it.

- RB
1T3XT info
2009-02-20 09:20:22 UTC
Permalink
Post by Cool The Breezer
https://svgsalamander.dev.java.net/
Can we use this for commercial purpose? As per its license, its covered under LGPL and I am not sure whether commercially it can be used without purchasing it.
LGPL'ed software can be used in commercial applications
"as long as you don't violate the license".
For instance: you can create a product and sell it, hiding the fact
that svgsalamander (or iText) is used. Your customers need to know
that svgsalamander (or iText) is inside the product, and they need
to have access to the source code of svgsalamander (or iText).
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
Benjamin Rein
2009-02-20 09:16:55 UTC
Permalink
http://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License

Best regards
Benjamin



Cool The Breezer <***@yahoo.com>
20.02.2009 10:10
Bitte antworten an
***@yahoo.com; Bitte antworten an
Post all your questions about iText here
<itext-***@lists.sourceforge.net>


An
Post all your questions about iText here
<itext-***@lists.sourceforge.net>
Kopie

Thema
Re: [iText-questions] alternative to Batik for SVG images
https://svgsalamander.dev.java.net/
Can we use this for commercial purpose? As per its license, its covered
under LGPL and I am not sure whether commercially it can be used without
purchasing it.

- RB




------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source code:
SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
iText-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php






____________________________________________________________________

Viessmann IT Service GmbH
GeschÀftsfÌhrer: Dirk Klöckner, Dr. Harald Dörnbach
Sitz der Gesellschaft: Allendorf (Eder) - Registergericht:
AG Marburg (Lahn) - HRB 5324 - USt-IdNr.: DE258558424
____________________________________________________________________
Cool The Breezer
2009-02-20 10:40:45 UTC
Permalink
Thanks for information.
I am facing some issue wrt adding svg images to pdf document using svgsalamander library as the image always appears in a new page. So the image heading and image are always in two pages. I also tried to lower the scale of images. But still the svg image is added to new page.

ANy idea how to resolve this.

- RB
Subject: Re: [iText-questions] alternative to Batik for SVG images
Date: Friday, February 20, 2009, 4:20 AM
Post by Cool The Breezer
https://svgsalamander.dev.java.net/
Can we use this for commercial purpose? As per its
license, its covered under LGPL and I am not sure whether
commercially it can be used without purchasing it.
LGPL'ed software can be used in commercial applications
"as long as you don't violate the license".
For instance: you can create a product and sell it, hiding
the fact
that svgsalamander (or iText) is used. Your customers need
to know
that svgsalamander (or iText) is inside the product, and
they need
to have access to the source code of svgsalamander (or
iText).
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009,
San Francisco, CA
-OSBC tackles the biggest issue in open source: Open
Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open
source participation
-Receive a $600 discount off the registration fee with the
source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
1T3XT info
2009-02-20 11:10:05 UTC
Permalink
Post by Cool The Breezer
Thanks for information.
I am facing some issue wrt adding svg images to pdf document
using svgsalamander library as the image always appears in a new page.
So the image heading and image are always in two pages.
I also tried to lower the scale of images. But still the svg image is added to new page.
ANy idea how to resolve this.
Not if you don't show us any code.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
Cool The Breezer
2009-02-20 11:42:12 UTC
Permalink
Following code adds svg image

java.io.InputStream inStream = new FileInputStream("./src/imgs/"+imgname);

URI uri = universe.loadSVG(inStream,imgname);
SVGDiagram diagram = universe.getDiagram(uri);
diagram.render(graphics);

Image image = Image.getInstance(template);
image.scaleToFit(PageSize.A4.getWidth(), PageSize.A4.getHeight());
// image.scalePercent(20);

//document.add(new Paragraph(Chunk.NEWLINE));
document.add(new Paragraph(new Chunk(imgtitle,FontFactory.getFont("Arial Narrow", 12, Font.BOLD))));
document.add(new Paragraph(Chunk.NEWLINE));
document.add(image);
document.add(new Paragraph(Chunk.NEWLINE));

inStream.close();


Then I add some paragraph

paraStr = paraStr.replaceAll("\n", " ");
paragraph = new Paragraph (paraStr,FontFactory.getFont("Arial Narrow", 10, Font.NORMAL));
paragraph.setIndentationLeft(120f);
paragraph.setAlignment(Element.ALIGN_LEFT);
document.add(paragraph);


In the result,
------------------------Page Break------------------------
some text/paragraphs

Image Title
{Some space}
Paragraph
----------------------Page Break ------------------------

Image
-------------------- Page Break -------------------------

Actually, it should have appeared after Image title. OR image title and image should appear in new page, then paragraph text if allowed in page.

let me know I could able to explain my problem properly.

Thanks
- RB
Cool The Breezer
2009-02-20 12:08:41 UTC
Permalink
Following code adds svg image

java.io.InputStream inStream = new FileInputStream("./src/imgs/"+imgname);

URI uri = universe.loadSVG(inStream,imgname);
SVGDiagram diagram = universe.getDiagram(uri);
diagram.render(graphics);

Image image = Image.getInstance(template);
image.scaleToFit(PageSize.A4.getWidth(), PageSize.A4.getHeight());
// image.scalePercent(20);

//document.add(new Paragraph(Chunk.NEWLINE));
document.add(new Paragraph(new Chunk(imgtitle,FontFactory.getFont("Arial Narrow", 12, Font.BOLD))));
document.add(new Paragraph(Chunk.NEWLINE));
document.add(image);
document.add(new Paragraph(Chunk.NEWLINE));

inStream.close();


Then I add some paragraph

paraStr = paraStr.replaceAll("\n", " ");
paragraph = new Paragraph (paraStr,FontFactory.getFont("Arial Narrow", 10, Font.NORMAL));
paragraph.setIndentationLeft(120f);
paragraph.setAlignment(Element.ALIGN_LEFT);
document.add(paragraph);


In the result,
------------------------Page Break------------------------
some text/paragraphs

Image Title
{Some space}
Paragraph
----------------------Page Break ------------------------

Image
-------------------- Page Break -------------------------

Actually, it should have appeared after Image title. OR image title and image should appear in new page, then paragraph text if allowed in page.

let me know I could able to explain my problem properly.

Thanks
- RB
1T3XT info
2009-02-20 14:41:36 UTC
Permalink
Post by Cool The Breezer
image.scaleToFit(PageSize.A4.getWidth(), PageSize.A4.getHeight());
That's not correct: you didn't take into account the page margins,
you didn't take into account the space taken by the image title.
There was no way we could have guessed you're resizing the image to a
size that doesn't fit the page.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
Cool The Breezer
2009-02-24 09:02:48 UTC
Permalink
Post by Cool The Breezer
Post by Cool The Breezer
image.scaleToFit(PageSize.A4.getWidth(),
PageSize.A4.getHeight());
That's not correct: you didn't take into account
the page margins,
you didn't take into account the space taken by the
image title.
You are right, when I reduced scale to 400, 400, image and its title appeared in one page. However the problem is if I increase it little bit the image appeared in a new page and texts supposed to appear after image, are appeared before image. Hence it was totally messed.

Hence can it possible
- Always ensure that even if the image appears in a new page, but the texts should appear properly i.e. texts that are supposed to appear after image, are appearing after image page.

- How can I know whether Image can be fit current page or not, so that I can make sure that image is appearing in a new page.

Appreciate your help on this.

- RB
1T3XT info
2009-02-24 09:15:08 UTC
Permalink
Post by Cool The Breezer
- Always ensure that even if the image appears in a new page, but the texts should appear properly i.e. texts that are supposed to appear after image, are appearing after image page.
writer.setStrictImageSequence(true);
Post by Cool The Breezer
- How can I know whether Image can be fit current page or not, so that I can make sure that image is appearing in a new page.
With ColumnText in simulation mode.
You could also ask for the Y position and calculate the remaining space.
There's more than one way to do this.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
Cool The Breezer
2009-02-24 09:52:08 UTC
Permalink
Thanks for help. I think I solved image problem wrt page. But the when Image appears in a new page, the image title also appears in a new page too. Any suggestion to make sure that title and image appear in the same page.

- RB
Subject: Re: [iText-questions] alternative to Batik for SVG images
Date: Tuesday, February 24, 2009, 4:15 AM
Post by Cool The Breezer
- Always ensure that even if the image appears in a
new page, but the texts should appear properly i.e. texts
that are supposed to appear after image, are appearing after
image page.
writer.setStrictImageSequence(true);
Post by Cool The Breezer
- How can I know whether Image can be fit current page
or not, so that I can make sure that image is appearing in a
new page.
With ColumnText in simulation mode.
You could also ask for the Y position and calculate the
remaining space.
There's more than one way to do this.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009,
San Francisco, CA
-OSBC tackles the biggest issue in open source: Open
Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open
source participation
-Receive a $600 discount off the registration fee with the
source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
iText-questions mailing list
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.1t3xt.com/docs/book.php
1T3XT info
2009-02-24 10:10:17 UTC
Permalink
Post by Cool The Breezer
Thanks for help. I think I solved image problem wrt page. But the when Image appears in a new page, the image title also appears in a new page too. Any suggestion to make sure that title and image appear in the same page.
Post by 1T3XT info
With ColumnText in simulation mode.
--
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info
Continue reading on narkive:
Loading...