Re: PDF size reduction

2017-05-17 Thread TvT
Another possibility is to post process your PDF. We for instance first
generate the PDF and afterwards use some other PDF library to shrink the
images and remove unused objects and other stuff...
If something is possible with a PDF in question you may try out with
acrobat - there are options to optimize and shrink your PDF. If there is no
reduction in file size with those options you may already have the perfect
PDF without any overhead ;-)

2017-05-16 22:10 GMT+02:00 Peter Hansson 
:

> Hi Spoorthi
>
> Another angle:
> I've found SVGs to be MUCH MORE efficient in terms of space usage. Try to
> see if you have those logos in SVG format instead and see if it helps.
>
> The added bonus of doing this is that image still looks nice even when the
> end-user is using the zoom function when looking at the PDF document.
>
> SVGs cannot do everything that say JPEG can. For example Apache FOP
> doesn't have support for SVGs that use gradients. However, I've found that
> most corporate logos aren't that advanced and they typically work well with
> SVG format.
>
> Give it a try.
> For example something like this:
>
>  
>
>
> Peter
>
>
>
> On Tuesday, May 16, 2017 6:55 PM, Frank Hirsch 
> wrote:
>
>
> Personally I use Apache FOP for some projects - but I am not quite an
> expert when it comes to Java…
>
> As far as I understand you may want to adjust the image
> resolution/compression to shrink the size of the files used in you FO - but
> I am not sure if this can be done automatically using a different image
> handling subsystem (https://xmlgraphics.apache.org/fop/0.95/graphics.html).
> Changing the color space may only affect the color profile/representation,
> but I don’t think this will preprocess the image size at all (sRGB is just
> a smaller gamut than Adobe RGB and RGB) - you may just get a different
> representation of colors outside the given gammut!
>
> From my perspective, it’s the same thing as placing an image in a layout
> software: the image will be used „as is“. Only when it comes to write the
> PDF you may have the ability to „donwsample“ all images to a given
> resolution relative to the size in the layout…
>
> - One solution might be to adjust the images to a proper size and
> compression accordingly to the layout
> - Alternatively you may „optimize“ the PDF for internet use: resample,
> compress and remove duplicates (images used multiple times)
>
> Just a few ideas which may help if there is no native solution in Apache
> FOP ;-)
> If there is no working solution in FOP, I may send you a link to a
> freeware to optimize the final PDF
>
> The FOP guys may forgive me if I am completely wrong ;-)
>
> Best,
> Frank
>
> Am 16.05.2017 um 17:50 schrieb spoorthi myneni - TECRA <
> spoorthi.myn...@tecra.com>:
>
> Hi Team,
>
> We have a requirement to reduce the size of the PDF size from
> 200Kb(approximately) to as less as possible. There are 5 images in the PDF
> that I am using.
>
> PDF size without images is coming up to 40Kb.
> Each Image size(jpegs): CCX logo- 60Kb, 3 small images: 18kb each, SMS
> logo - 50Kb approximately.
>
> The PDF size is increased as mush as the image size is. Is there a way for
> us to optimize the image size or the PDF size in FO?
> I have already set this property: true
> 
>
>
> Please let me know if there are any techniques to achieve this. Has there
> been any enhancements done in the FOP 2.0?
>
> Thank you,
> Spoorthi
>
>
>
>


Re: Is it possible to merger pdf's using xsl-fo alone?

2014-07-04 Thread TvT
If you have two PDF documents then it is not possible to merge those with
XSL-FO / Apache FOP.
You have to use iText or PdfBox for this...

If you have two XSL-FO files you may be able to merge those with normal xml
operations and afterwards create one pdf out of it...


2014-07-03 14:34 GMT+02:00 Vijaya Raghavan.R vijayaraghava...@solartis.net
:

 Is it possible to merge pdf's using xsl-fo alone...?

 Hi,

 Now we are using Itext for merging pdf's.
 Is there any solution to merge pdf's without using itext..

 Note: Is it possible to merge pdf's in xsl fo ? If yes, guide me.

 Thanks in advance





 --
 View this message in context:
 http://apache-fop.1065347.n5.nabble.com/Is-it-possible-to-merger-pdf-s-using-xsl-fo-alone-tp40856.html
 Sent from the FOP - Users mailing list archive at Nabble.com.

 -
 To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org




Re: Free 3 of 9

2013-04-18 Thread TvT
2013/4/18 nels nbhc...@gmail.com

 barcode Free 3 of 9 fonts



Hi,

are you using barcode4j?
The examples are here: http://barcode4j.sourceforge.net/examples.html

If you then open the exampe you will find:

  xsl:variable name=barcode-cfg
  barcode
code128
  human-readablenone/human-readable
  height8mm/height
  quiet-zone enabled=false/
/code128
  /barcode
/xsl:variable
xsl:copy-of select=barcode:generate($barcode-cfg,
/invoice/header/invoicenr)/

Depending on the type of barcode (for you code 39) you can use different
options:

http://barcode4j.sourceforge.net/2.1/barcode-xml.html

barcode message=123456789
http://barcode4j.sourceforge.net/2.1/barcode-xml.html#string
  code39 http://barcode4j.sourceforge.net/2.1/symbol-code39.html
height15mm
http://barcode4j.sourceforge.net/2.1/barcode-xml.html#length/height
module-width0.19mm
http://barcode4j.sourceforge.net/2.1/barcode-xml.html#length/module-width
wide-factor2.5
http://barcode4j.sourceforge.net/2.1/barcode-xml.html#number/wide-factor
interchar-gap-width1mw
http://barcode4j.sourceforge.net/2.1/barcode-xml.html#length/interchar-gap-width
quiet-zone enabled=true
http://barcode4j.sourceforge.net/2.1/barcode-xml.html#boolean10mw
http://barcode4j.sourceforge.net/2.1/barcode-xml.html#length/quiet-zone
checksumauto
http://barcode4j.sourceforge.net/2.1/barcode-xml.html#checksum-mode/checksum
human-readable
  placementbottom
http://barcode4j.sourceforge.net/2.1/barcode-xml.html#human-readable-placement/placement
  font-nameHelvetica
http://barcode4j.sourceforge.net/2.1/barcode-xml.html#font-name/font-name
  font-size8pt
http://barcode4j.sourceforge.net/2.1/barcode-xml.html#length/font-size
  pattern{string}
http://barcode4j.sourceforge.net/2.1/barcode-xml.html#string/pattern
!-- see below http://barcode4j.sourceforge.net/2.1/barcode-xml.html#pattern
for details --
  display-start-stopfalse
http://barcode4j.sourceforge.net/2.1/barcode-xml.html#boolean/display-start-stop
  display-checksumfalse
http://barcode4j.sourceforge.net/2.1/barcode-xml.html#boolean/display-checksum
/human-readable
  /code39 http://barcode4j.sourceforge.net/2.1/symbol-code39.html
/barcode

Regards,
ToM


Re: PDF size reduction

2011-05-03 Thread TvT
Hi,

i agree with Michael - reducing the image size is the key.
We had this problem once with huge TIFF files which can (after scanning)
easily have a size of 50MB or bigger.
With the java image io we converted those pics into TIFF-G4 standard which
are greatly reduced in size (kb level).

Afterwards also our pdfs were much smaller. If you own Adobe Acrobat you can
try the effect of reducing the image quality / adding compression. Go to
Advanced/PDF-Optimization ...

Regards,
ToM

2011/5/3 Giuseppe Briotti g.brio...@gmail.com



 2011/5/3 Giuseppe Briotti g.brio...@gmail.com



 2011/5/3 Michael Rubin mru...@thunderhead.com

  If you aren't bothered about image quality, then (albeit not knowing
 what format the image is currently) can you not use something like high JPEG
 compression on the graphics? This will dramatically reduce the image size
 and therefore the PDF size.

 Thanks.

 -Mike



 Well, it seems that my message was sent without content. I agree with
 Pascal: you can avoid to load the color profile. If this is not enough, you
 can try to process all the images via batch. There are several tools that
 can allow that. Try for example Image Magick...


 G.

 --

 Giuseppe Briotti
 g.brio...@gmail.com

 Alme Sol, curru nitido diem qui
 promis et celas aliusque et idem
 nasceris, possis nihil urbe Roma
 visere maius.
 (Orazio)



Re: Footenote space / margin / distance / padding

2011-02-17 Thread TvT
Hi,

i read the specific part which confirms that the footnotes are part of
the region body. (The region-body has two conditional sub-regions
which implicitly specify corresponding reference-areas called
before-float-reference-area and footnote-reference-area.)

Possibly footnote-separators could be used to control the space
between footnotes however i am not sure whether FOP 1.0 supports
footnote-separators? There is nothing on the compliance page
http://xmlgraphics.apache.org/fop/compliance.html
and the mailing list entries for footnote-separators are quite old
(0.20.5 times)

Anyone knows something about it?

Regards,
ToM

2011/2/16 Amick, Eric eric.am...@mail.house.gov:
 The xsl-footnote-separator feature described in section 6.12.1.3 of the spec 
 should be what you're looking for.

 http://www.w3.org/TR/xsl/#pg-out-of-line

 Eric Amick   Systems Engineer II
 Legislative Computer Systems

 -Original Message-
 From: TvT [mailto:tvtre...@nepatec.de]
 Sent: Wednesday, February 16, 2011 13:18
 To: fop-users@xmlgraphics.apache.org
 Subject: Footenote space / margin / distance / padding

 Hi,

 i create a PDF file with a table and in some of the cells i use
 footnotes.
 Sometimes if the table is big and continued on the next page, the last
 cell touches directly the first footnote at the bottom.

 I played around with the regions, margins, padding, space.before and
 stuff but nothing worked so far.
 E.g. i tried:
 fo:footnote-body padding-before=4pt

 Initially i thought that footnotes are printed in the region-after
 however its seems that they are printed at the bottom of the
 page-body.
 Is there anyway to put some space between the footnotes and the last
 element?

 Thanks
 ToM

 -
 To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org


 -
 To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Footenote space / margin / distance / padding

2011-02-16 Thread TvT
Hi,

i create a PDF file with a table and in some of the cells i use footnotes.
Sometimes if the table is big and continued on the next page, the last
cell touches directly the first footnote at the bottom.

I played around with the regions, margins, padding, space.before and
stuff but nothing worked so far.
E.g. i tried:
fo:footnote-body padding-before=4pt

Initially i thought that footnotes are printed in the region-after
however its seems that they are printed at the bottom of the
page-body.
Is there anyway to put some space between the footnotes and the last element?

Thanks
ToM

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Filesize and embedded fonts

2010-11-17 Thread TvT
Hi Lui,

(in PDF) there is the possibility to subset a font - thus to only
include a subset of the font which you need.
Read here:
http://desktoppub.about.com/od/pdf/f/subsetfonts.htm

What you can do in FOP is described here:
http://xmlgraphics.apache.org/fop/1.0/fonts.html

There is a paragraph about 'Embedding' fonts and also a small part
about subsetting.
You are using TrueType Fonts?
When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a
subset of the original font, containing only the glyphs used, is
embedded in the output document.

Check in the Acrobat Reader under File\Properties\Fonts that there are
only subsets of Fonts. If not try to change your font format. If the
subsetting worked then it will be difficult with plain FOP to reduce
the file size. Then you probably have to use a third party tool to
reduce the file size...

Regards,
ToM

PS:
One other thing, is there a special reason you are still using font
metric files? Since 0.95 this is usually not necessary anymore.

In earlier FOP versions, it was always necessary to create an XML
font metrics file if you wanted to add a custom font. This
unconvenient step has been removed and in addition to that, FOP
supports auto-registration of fonts, i.e. FOP can find fonts installed
in your operating system or can scan user-specified directories for
fonts. Font registration via XML font metrics file is still supported
and may still be necessary for some very special cases as fallback
variant while we stabilize font auto-detection.





2010/11/16 Tobias Luikard t.luik...@exxcellent.de:
  Hi everybody,

 since several years I use fop to produce PDFs. Now the request was to
 produce PDF/A documents. So I embedded all fonts necessary for the
 productions of the PDF.

 After some test and some errors I was able to produce PDF/A complient
 documents (at least FOP didn't throw any exceptions any more). But the
 problem is, that the size of the files increased 10 times (from 25,3 kB to
 248 kB).

 The fonts where embedded as True Type fonts in the fop.xml
 fonts
 font embed-url=XXFont.ttf kerning=yes metrics-url=XXFont.xml
 font-triplet name=XX style=normal weight=normal /
 /font
         ...
 /fonts

 I tried to convert the file with Acrobat. There the file size has grown but
 not that much. Does anyone have any suggestion how to reduce the file size?
 Do I make any errors when I include the fonts?

 The mass of file we have to put into the archive will be a problem when the
 file will be 1/4 MB of size...

 Thanks

 Tobi

 P.S. I'm using FOP 1.0, JDK 1.6.0_13 and Windows Vista


 --
  Tobias Luikard

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Referring to a image file in a JAR file

2010-07-23 Thread TvT
Hi,

since the jar with our images was on the classpath we could reference
the image directly:

fo:external-graphic src=urn:some_logo.gif/

- urn: was the trigger for us in our resource resolver...

Regards,
ToM

2010/7/22 Bernard Giannetti thebernmeis...@hotmail.com:
 I already have a URIResolver implemented to resolve the something such as

     xsl:include href=pagesetup.xsl /

 which is what the Javadoc says it's used for:

 http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/javax/xml/transform/URIResolver.html

 Unfortunately, the fo:external-graphic src=file://myapp.jar!/image.svg
 content-width=8 content-height=8 does not trigger the call to my URI
 resolver.  I have tried src=url() etc with no luck.  So either I've got
 the wrong format of the URL or it cannot be done this way.

 I don't see how to use xls:include, xsl:import and document (as per the
 Javadoc) to refer to the graphic file.  In your example, did you refer to
 images using fo:external-graphic or using some other tag?

 The other thing I noticed is I set my URIResolver on the TransformerFactory:

 SAXTransformerFactory saxTransformerFactory =
 (SAXTransformerFactory)TransformerFactory.newInstance();
 saxTransformerFactory.setURIResolver( myURIResolver );

 instead of on the foUserAgent which you did...so dunno if that makes a
 difference.


 Date: Wed, 21 Jul 2010 17:16:03 +0200
 Subject: Re: Referring to a image file in a JAR file
 To: fop-users@xmlgraphics.apache.org

 Hi,

 we needed exactly that and implemented our own ResourceResolver for
 that.
 You can register it like the following:

 //Register a custom resolver
 foUserAgent.setURIResolver(new ClasspathResourceResolver());

 //The clas has to implement the URIResolver
 public class ClasspathResourceResolver implements URIResolver {

 //you overwrite the resolve method
 public InputStream resolve(String uri){

 //Resolves the path to a resource in the classpath (since that jar
 should be in the classpath
 this.getClass().getResourceAsStream(uri);

 Regards,
 ToM

 
 Find it on Domain.com.au Need a new place to live?

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: Referring to a image file in a JAR file

2010-07-21 Thread TvT
Hi,

we needed exactly that and implemented our own ResourceResolver for that.
You can register it like the following:

//Register a custom resolver
foUserAgent.setURIResolver(new ClasspathResourceResolver());

//The clas has to implement the URIResolver
public class ClasspathResourceResolver implements URIResolver {

//you overwrite the resolve method
public InputStream resolve(String uri){

//Resolves the path to a resource in the classpath (since that jar
should be in the classpath
this.getClass().getResourceAsStream(uri);

Regards,
ToM


2010/7/21 Bernard Giannetti thebernmeis...@hotmail.com:
 Hi,

 I am trying to refer to a graphic file within a JAR file.  The JAR file
 contains the application which is being executed along with the
 aforementioned graphic file.

 The application is launched via JNLP - so not sure if that effects what I am
 trying to do.

 If the JAR file is myapp.jar and the graphic is say image.svg then the tag

 fo:external-graphic src=file://myapp.jar!/image.svg content-width=8
 content-height=8 results in the error

 Error with opening URL 'file://myapp.jar!/image.svg'

 I have tried different variations on the src attribute, say file:/// and
 then also url('/image.svg') but with similar errors.

 Is it possible to reference an image file within the same JAR as the
 application?


 Thanks in advance,

 Bernard.

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org



Re: AW: “CIDset in subset font is incomplete” er ror by pdf/a-1b validation

2010-06-22 Thread TvT
Hi Jeremias,

I've reported a number of bugs in to the black hole called Adobe Support
 back
 when I implemented PDF/A support for FOP.


Just mail those bugs to Leonard Rosenthol (lrosenth [a] adobe.com).
He is the responsible guy at adobe for that kind of stuff and usually
replies ...

Regards,
ToM



 You could send me a small PDF example with which you have a problem and
 I can take a look. Maybe you've stumbled on a case which was never
 encountered before. An other idea is to switch fonts and see if anything
 changes.

 On 21.06.2010 14:01:31 Virginjus Kandrotas wrote:
  Hello Jeremias,
 
  I just downloaded current FOP Trunk. Unfortunately the problem regarding
 validation against Adobe Preflight and “pdfaPilot” still exist. Using my
 workaround with ansi fonts is working, but this option increase each pdf
 output document at  ~180 kb. Can you please explain dthis behavior? Why
 standard pdfa-1b fop font encoding is still not working ? Have you ever
 tested you pdfa-1b output documents against Acrobat Preflight, if yes, can
 you please send me working exmaple.fo and fop.xconf ?
 
  Best regards,
 
  Virginijus
 
  --- Virginjus Kandrotas vkandrot...@yahoo.com schrieb am Fr,
 16.4.2010:
 
   Von: Virginjus Kandrotas vkandrot...@yahoo.com
   Betreff: AW: “CIDset in subset font is incomplete” error by pdf/a-1b
 validation
   An: fop-users@xmlgraphics.apache.org
   Datum: Freitag, 16. April, 2010 13:06 Uhr
   Hello everybody interesting in this
   problem,
  
   after different test scenarios I have found solution to my
   problem. To avoid following error “CIDset in subset font
   is incomplete” I used ansi encoded font metrics (default
   by fop TTFReader is CID-keyed). Both validators shows no
   errors on new created pdf documents. To generate  ansi
   encoded metrics TTFReader should be called with “-enc
   ansi” option.
  
   It is still open question why it is not working with
   standard CID-keyed metrics, maybe FOP guru's can answer it?
  
  
  
   Best regards,
  
   Virginijus
  
   --- Virginjus Kandrotas vkandrot...@yahoo.com
   schrieb am Do, 15.4.2010:
  
Von: Virginjus Kandrotas vkandrot...@yahoo.com
Betreff: “CIDset in subset font is incomplete”
   error by pdf/a-1b validation
An: fop-users@xmlgraphics.apache.org
Datum: Donnerstag, 15. April, 2010 10:25 Uhr
Hello,
   
I am trying to use fop 0.95 to generate pdf/a-1b
   conform
documents. By validating created pdf document
against
“callas pdfaPilot“ online demo version
 http://www.datalogics.com/products/callas/callaspdfA-onlinedemo.asp
as well Acrobat Professional Preflight function I am
   getting
following error:
   
“CIDset in subset font is incomplete (1 match on 1
   page)
   
Text Gladiator,Bold 12.0 pt TrueType (CID) embedded
   (as a
subset) (1 match)”
   
As example fo input file I am using fop 0.95
test/xml/pdf-a/minimal-pdf-a.fo and test/test.xconf
   config
file.
   
Can anybody explain what is wrong here ?
   
Best Regards,
   
Virginijus
   
__
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen
herausragenden Schutz gegen Massenmails.
http://mail.yahoo.com
   
   
   -
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail:
 fop-users-h...@xmlgraphics.apache.org
   
   
  
   __
   Do You Yahoo!?
   Sie sind Spam leid? Yahoo! Mail verfügt über einen
   herausragenden Schutz gegen Massenmails.
   http://mail.yahoo.com
  
   -
   To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
   For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
  
  
 
 
 
  -
  To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
  For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
 




 Jeremias Maerki


 -
 To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
 For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org




Re: Embedding PDF base into a FO document (at least for PDF output)

2010-06-01 Thread TvT
Hi,

 My goal is to be able to use (for
 instance) - a base pdf with a sheet pre-prepared with text and graphics, and
 overprint an address on the document, is that something within the
 capability of the library? Or is there another way to achieve this goal ?

We have done something similar with iText i guess:

There you can add a text to a layer above or below the normal text
layer (e.g. like a watermark)
You use getUnderContent() oder getOverContent Method and add your own
address, other text/images or whatever

(Regarding iText http://itextpdf.com - i would suggest you use the
version 2.1.7 since the new version has a changed license)

Regards,
ToM

Ps: Code like that:

//adds text to the first page
PdfContentByte underOverContent = this.stamper.getUnderContent(1);

underOverContent.beginText();
underOverContent.setFontAndSize(Font, FontSize);
underOverContent.showTextAligned(Element.ALIGN_CENTER,Some Text,X,Y,Rotation);
underOverContent.endText();

-
To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org