voyent
OS Font Rendering Issue (Fix)  XML
Forum Index -> ICEpdf General
Author Message
pedrojrivera

Joined: 20/Nov/2008 00:00:00
Messages: 55
Offline


As I was spot checking some rendered TIF images I spotted some images with badly rendered text. Some fonts were not being rendered properly. I recently updated the Crystal Reports JAR files from XI to 2008 version when I detected some issues.

Well I put the program in debug and discovered that the font names are coming back like this:

AAAAAB+Arial
AAAAAB+Arial
AAAAAC+CalistoMTBold
AAAAAD+Cambria
AAAAAE+CambriaBoldItalic
AAAAAF+CambriaBold
AAAAAG+CambriaItalic
AAAAAH+VerdanaBoldItalic
AAAAAI+BarCode39e
AAAAAJ+Verdana
AAAAAK+TimesNewRomanBold

I traced it back to the FontUtil.guessFamily() method. It was getting rid of the style portion when there is a "+" or "," but did no further checking for embedded styles within the font name.

I modified the method to include this checking. I have attached a zip file with the original PDF and the before and after TIF image conversion.

Pedro
 Filename FontUtil.zip [Disk] Download
 Description
 Filesize 1401 Kbytes
 Downloaded:  616 time(s)


patrick.corless

Joined: 26/Oct/2004 00:00:00
Messages: 1982
Offline


Thanks Pedro, created PDF-206 so we don't lose this enhancement.
[Email]
a573815

Joined: 06/Sep/2017 02:27:10
Messages: 6
Offline


HI,

I have got stuck in issue.
As suggested by pedrojrivera (http://www.icefaces.org/JForum/posts/list/17504.page )solution ,i am able to convert PDF TO TIFF .But the converted TIFF image having missing image.Its showing as beta in converted TIF (as attached).


Any prompt help is appreciated.

Regards
Abhishek Kaushik

[Thumb - PDF.JPG]
 Filename PDF.JPG [Disk] Download
 Description
 Filesize 27 Kbytes
 Downloaded:  988 time(s)

[Thumb - convertedTIFF.JPG]
 Filename convertedTIFF.JPG [Disk] Download
 Description
 Filesize 17 Kbytes
 Downloaded:  1028 time(s)

patrick.corless

Joined: 26/Oct/2004 00:00:00
Messages: 1982
Offline


Interesting, are you using the save version of ICEpdf for each capture. It looks like the Tiff version might not be using the PRO or trial version?
[Email]
a573815

Joined: 06/Sep/2017 02:27:10
Messages: 6
Offline


Hello patrick,

I am using "jai_imageio_6.jar" as in (http://www.icefaces.org/JForum/posts/list/17504.page) TIFConvert.zip.

Using java file TIFConvertPDF.java(also attached).

Can prompt response is appreciated.i am totally gated due to this.

Regards
Abhishek
patrick.corless

Joined: 26/Oct/2004 00:00:00
Messages: 1982
Offline


Looks like we posted at the same time, can you post a PDF document that has the same logo in it?
[Email]
a573815

Joined: 06/Sep/2017 02:27:10
Messages: 6
Offline


Attached Zip which i am using to convert PDF Bytes into TIFF Bytes. code snippet is given below:-

try {
byte[] byteArray = ecrServiceBO.fetchPdfBytesFromDB(uniqueID);
TIFConvertPDF TiffConvert = new TIFConvertPDF();

byte[] b = TiffConvert.convert(byteArray, 100,
TiffConvert.CLR_RGB ,
TiffConvert.COMPRESSION_LZW, .25f);
response.setContentType("image/tiff");
response.addHeader("Content-Disposition", "attachment; filename="
+ "Ecr_Report.tiff");
response.getOutputStream().write(b);
response.getOutputStream().flush();
} catch (Exception ex) {
ex.printStackTrace();
LOGGER.info("File Does not exists for provided uniqueID ::"
+ uniqueID);
response.setContentType("application/json;charset=UTF-8");
PrintWriter out = response.getWriter();
out.print("{\"error\":1}");
response.sendError(HttpServletResponse.SC_BAD_REQUEST);
}
}


Regards
Abhishek
 Filename TIFConvert.zip [Disk] Download
 Description
 Filesize 1572 Kbytes
 Downloaded:  322 time(s)

a573815

Joined: 06/Sep/2017 02:27:10
Messages: 6
Offline


Due to compliance issue, i can only post that part which is not not getting generated.
[Thumb - PDF.JPG]
 Filename PDF.JPG [Disk] Download
 Description this is the pdf snapshot
 Filesize 27 Kbytes
 Downloaded:  929 time(s)

patrick.corless

Joined: 26/Oct/2004 00:00:00
Messages: 1982
Offline


I don't see any trouble with the capture code. Given the Beta, I have a feeling its a font loading issue. I'd recommend trying the trial version of PRO first.

If pro isn't an option then try the following system property which will try to get Java to load the font.
-Dorg.icepdf.core.awtFontLoading=true

There might still be an issue with the class path with regard to JAI, If you have a maven setup you'll need the following.

Code:
<repositories>
                 <repository>
                                 <id>jboss-3rd-party-releases</id>
                                 <url>https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/</url>
                 </repository>
 </repositories>
 
 <dependencies>
                 <dependency>
                                 <groupId>javax.media</groupId>
                                 <artifactId>jai_core</artifactId>
                                 <version>1.1.3</version>
                 </dependency>
                 <dependency>
                                 <groupId>com.sun.media</groupId>
                                 <artifactId>jai-codec</artifactId>
                                 <version>1.1.3</version>
                 </dependency>
                 <dependency>
                                 <groupId>com.sun.media</groupId>
                                 <artifactId>jai_imageio</artifactId>
                                 <version>1.1</version>
                 </dependency>
 
 </dependencies>
 

[Email]
 
Forum Index -> ICEpdf General
Go to:   
Powered by JForum 2.1.7ice © JForum Team