<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to patches</title><link href="https://sourceforge.net/p/jpodlib/patches/" rel="alternate"/><link href="https://sourceforge.net/p/jpodlib/patches/feed.atom" rel="self"/><id>https://sourceforge.net/p/jpodlib/patches/</id><updated>2014-07-11T18:38:01.030000Z</updated><subtitle>Recent changes to patches</subtitle><entry><title>#3 Some useful functions for jPod: TIFF, JPEG, lossless, unicode TTF writing</title><link href="https://sourceforge.net/p/jpodlib/patches/3/?limit=25#73b1" rel="alternate"/><published>2014-07-11T18:38:01.030000Z</published><updated>2014-07-11T18:38:01.030000Z</updated><author><name>Antti S. Lankila</name><uri>https://sourceforge.net/u/alankila/</uri></author><id>https://sourceforge.net03ce8675a96d7cc1b56af0f98e9582d4f47cc4ba</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;... and excuse the name. This was supposed to be called jpodimprovements but I was just studying recent changes in pdfbox when I prepared the file.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#3 Some useful functions for jPod: TIFF, JPEG, lossless, unicode TTF writing</title><link href="https://sourceforge.net/p/jpodlib/patches/3/?limit=25#a7dd" rel="alternate"/><published>2014-07-11T12:17:32.745000Z</published><updated>2014-07-11T12:17:32.745000Z</updated><author><name>Antti S. Lankila</name><uri>https://sourceforge.net/u/alankila/</uri></author><id>https://sourceforge.netca283359e45ecbe7637eff48ad2875a4d1880115</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;OK, this is the new version. I added the 3-clause BSD license (which is what I assume you mean by "lesser") as a javadoc for the class.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#3 Some useful functions for jPod: TIFF, JPEG, lossless, unicode TTF writing</title><link href="https://sourceforge.net/p/jpodlib/patches/3/?limit=25#7a35" rel="alternate"/><published>2014-06-10T07:24:17.719000Z</published><updated>2014-06-10T07:24:17.719000Z</updated><author><name>mtraut</name><uri>https://sourceforge.net/u/mtraut/</uri></author><id>https://sourceforge.net9fe972c277c6843a159b3de4001948ed7e4d2d50</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you for your support.&lt;/p&gt;
&lt;p&gt;I hope we can come back to your submission with our next release. To enable us to do so, please decorate your code/posting clearly with lesser BSD license agreement.&lt;/p&gt;
&lt;p&gt;Currently we are very busy, so please forgive any delay.&lt;/p&gt;
&lt;p&gt;Maven repository is not supported by us. We currently only provide code as a file download on this site. The maven submission is managed by a third party supporter.&lt;/p&gt;
&lt;p&gt;Regards, Michael&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#3 Some useful functions for jPod: TIFF, JPEG, lossless, unicode TTF writing</title><link href="https://sourceforge.net/p/jpodlib/patches/3/?limit=25#cc6f" rel="alternate"/><published>2014-06-06T11:22:47.032000Z</published><updated>2014-06-06T11:22:47.032000Z</updated><author><name>Antti S. Lankila</name><uri>https://sourceforge.net/u/alankila/</uri></author><id>https://sourceforge.net12e683071abf08ce5ca10564a17284bfc67f5eca</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I was able to add the cmap generation too.&lt;/p&gt;
&lt;p&gt;Something like this:&lt;br /&gt;
            StringBuilder cmapContents = new StringBuilder();&lt;br /&gt;
            cmapContents.append("/CIDInit /ProcSet findresource begin\n");&lt;br /&gt;
            cmapContents.append("12 dict begin\n");&lt;br /&gt;
            cmapContents.append("begincmap\n");&lt;br /&gt;
            cmapContents.append("/CIDSystemInfo &amp;lt;&amp;lt; /Registry (Adobe) /Ordering (UCS) /Supplement 0 &amp;gt;&amp;gt; def\n");&lt;br /&gt;
            cmapContents.append(String.format("/CMapName /%s def\n", cmapName));&lt;br /&gt;
            cmapContents.append("/CMapType 2 def\n");&lt;br /&gt;
            cmapContents.append("1 begincodespacerange\n");&lt;br /&gt;
            cmapContents.append("&amp;lt;0000&amp;gt; \n");&lt;br /&gt;
            cmapContents.append("endcodespacerange\n");&lt;br /&gt;
&lt;br /&gt;
            /&lt;em&gt; Reverse the map from unicode -&amp;gt; glyph to glyph -&amp;gt; unicode. &lt;/em&gt;/&lt;br /&gt;
            Map&amp;gt;&amp;gt; map = unicodeMap.entrySet().stream().collect(Collectors.groupingBy(x -&amp;gt; x.getValue()));&lt;br /&gt;
            cmapContents.append(map.size() + " beginbfchar\n");&lt;br /&gt;
            for (Map.Entry&amp;gt;&amp;gt; entry : map.entrySet()) {&lt;br /&gt;
                int glyphId = (Integer) entry.getKey();&lt;br /&gt;
                cmapContents.append(String.format("&amp;lt;%04x&amp;gt; &amp;lt;", glyphId));&lt;br /&gt;
                /&lt;em&gt; What to do about multiple mappings? We could crash or something... &lt;/em&gt;/&lt;br /&gt;
                int codePoint = (Integer) entry.getValue().get(0).getKey();&lt;br /&gt;
                byte[] value = new String(Character.toChars(codePoint)).getBytes(StandardCharsets.UTF_16BE);&lt;br /&gt;
                for (byte b : value) {&lt;br /&gt;
                    cmapContents.append(String.format("%02x", b &amp;amp; 0xff));&lt;br /&gt;
                }&lt;br /&gt;
                cmapContents.append("&amp;gt;\n");&lt;br /&gt;
            }&lt;br /&gt;
            cmapContents.append("endbfchar\n");&lt;br /&gt;
            cmapContents.append("endcmap\n");&lt;br /&gt;
            cmapContents.append("CMapName currentdict /CMap defineresource pop\n");&lt;br /&gt;
            cmapContents.append("end\n");&lt;br /&gt;
            cmapContents.append("end\n");&lt;br /&gt;
            COSStream cmapObject = COSStream.create(null);&lt;br /&gt;
            cmapObject.setDecodedBytes(cmapContents.toString().getBytes(StandardCharsets.UTF_8));&lt;br /&gt;
            pdFont0.setToUnicode((CMap) InternalCMap.META.createFromCos(cmapObject));&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Some useful functions for jPod: TIFF, JPEG, lossless, unicode TTF writing</title><link href="https://sourceforge.net/p/jpodlib/patches/3/" rel="alternate"/><published>2014-06-05T13:41:49.481000Z</published><updated>2014-06-05T13:41:49.481000Z</updated><author><name>Antti S. Lankila</name><uri>https://sourceforge.net/u/alankila/</uri></author><id>https://sourceforge.netb0d1a691c035e76a69d5729ca126a3b97147868b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I spent a day switching away from pdfbox to jPod and adapted this library for my use case. I'm dumping this code over the fence without much support and I'm hoping that it is useful.&lt;/p&gt;
&lt;p&gt;Provided are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Multipage TIFF reader where CCITT streams are embedded into PDImages without decoding the TIFF other than at the tag level. This allows using jPod to implement something like tiff2pdf.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;JPEG reader where JPEG is embedded into PDImage without decoding it (other than looking up its width/height).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Lossless image support from any BufferedImage, for e.g. PNG. I cut all corners and just made it RGB image with full 8-bit alpha rather than trying to optimize it. I was pressed for time and I mostly deal with 32-bit ARGB images.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Very crude but nevertheless functioning unicode-encoded TTF loader that permits writing international text with jPod. I can't guarantee it's bug-free or anything, obviously it leaves much to be desired. The most important problem is its missing ToUnicode cmap.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While doing this work, I was impressed by the overall cleanliness and orderliness of the code.&lt;/p&gt;
&lt;p&gt;However, there are a few details that should be changed when it comes to unicode text handling. Firstly, it's not correct to prefer char[] as the unicode string representation because of surrogate pairs and code point values above 65536. The appropriate approach is to use String's method codePointAt(n) and then increment n by Character.charCount(codePoint). I think the optimal representation is a String instance. There is a sample of this approach in the anonymous inline Encoding class.&lt;/p&gt;
&lt;p&gt;Secondly, I had to use reflection to bang the cachedEncoding into PDFontType0. Trying to call setEncoding() resulted in a CMapEncoding being used rather than my own minimal encoder. I suspect that this issue has been fixed in the library release 5.6.0, but for some reason this version is not available in maven repository.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Added missing dependency</title><link href="https://sourceforge.net/p/jpodlib/patches/2/" rel="alternate"/><published>2011-02-03T15:46:58Z</published><updated>2011-02-03T15:46:58Z</updated><author><name>mtraut</name><uri>https://sourceforge.net/u/mtraut/</uri></author><id>https://sourceforge.netd9a8ce02db79baf6588047ca52f689cb796b9448</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Oooops - seemed i forgto to add the isCWT dependency last time. Added to the 5.3 dependency directory....&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>can't load cmap files</title><link href="https://sourceforge.net/p/jpodlib/patches/1/" rel="alternate"/><published>2008-12-04T07:15:03Z</published><updated>2008-12-04T07:15:03Z</updated><author><name>yusuke mihara</name><uri>https://sourceforge.net/u/yusukemihara/</uri></author><id>https://sourceforge.net71c20498647084afa9c66b9db2613926bc640abc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi, I tried jPodRender(5.0.RC3) for displaing japanese PDF.The PDF is EUC-H encoding and TrueType font type0?(attached).&lt;br /&gt;
I put EUC-H cmap file(downloaded from adobe) in the classpath.&lt;/p&gt;
&lt;p&gt;$(jartop)/cmaps/EUC-H.cmap&lt;br /&gt;
/mypackage/MyClass&lt;br /&gt;
...&lt;/p&gt;
&lt;p&gt;but, it does not work.it fails loading cmap file.&lt;/p&gt;
&lt;p&gt;backtrace is here.&lt;/p&gt;
&lt;p&gt;----&lt;br /&gt;
Exception in thread "AWT-EventQueue-0" de.intarsys.pdf.content.CSError: unexpect&lt;br /&gt;
ed exception&lt;br /&gt;
at de.intarsys.pdf.content.CSInterpreter.process(CSInterpreter.java:179)&lt;br /&gt;
at de.intarsys.pdf.content.CSDeviceBasedInterpreter.process(CSDeviceBase&lt;br /&gt;
dInterpreter.java:148)&lt;br /&gt;
at jpodtest.PDFCanvas.paint(PDFCanvas.java:92)&lt;br /&gt;
at javax.swing.JComponent.paintChildren(JComponent.java:864)&lt;br /&gt;
at javax.swing.JComponent.paint(JComponent.java:1036)&lt;br /&gt;
at javax.swing.JViewport.paint(JViewport.java:747)&lt;br /&gt;
at javax.swing.JComponent.paintChildren(JComponent.java:864)&lt;br /&gt;
at javax.swing.JComponent.paint(JComponent.java:1036)&lt;br /&gt;
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5122)&lt;br /&gt;
at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:285)&lt;br /&gt;
at javax.swing.RepaintManager.paint(RepaintManager.java:1128)&lt;br /&gt;
at javax.swing.JComponent._paintImmediately(JComponent.java:5070)&lt;br /&gt;
at javax.swing.JComponent.paintImmediately(JComponent.java:4880)&lt;br /&gt;
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:723)&lt;br /&gt;
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:679)&lt;br /&gt;
at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:659)&lt;br /&gt;
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)&lt;br /&gt;
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)&lt;br /&gt;
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)&lt;br /&gt;
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)&lt;br /&gt;
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)&lt;br /&gt;
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)&lt;br /&gt;
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)&lt;br /&gt;
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)&lt;br /&gt;
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)&lt;br /&gt;
Caused by: java.lang.ArrayIndexOutOfBoundsException: 97716&lt;br /&gt;
at de.intarsys.pdf.font.CIDFontType2.getGlyphIndex(CIDFontType2.java:89)&lt;br /&gt;
at de.intarsys.pdf.font.PDFontType0.getGlyphIndex(PDFontType0.java:175)&lt;br /&gt;
at de.intarsys.pdf.platform.cwt.font.freetype.FreetypeFont.loadGlyph(FreetypeFont.java:270)&lt;br /&gt;
at de.intarsys.pdf.platform.cwt.font.freetype.FreetypeFont.basicCreate(FreetypeFont.java:67)&lt;br /&gt;
at de.intarsys.pdf.platform.cwt.font.freetype.FreetypeFont.createPlatformGlyphs(FreetypeFont.java:189)&lt;br /&gt;
at de.intarsys.pdf.platform.cwt.rendering.CSPlatformDevice.basicTextShowGlyphs(CSPlatformDevice.java:217)&lt;br /&gt;
at de.intarsys.pdf.content.CSBasicDevice.textShow(CSBasicDevice.java:420)&lt;br /&gt;
at de.intarsys.pdf.platform.cwt.rendering.CSPlatformDevice.textShow(CSPlatformDevice.java:683)&lt;br /&gt;
at de.intarsys.pdf.content.CSDeviceBasedInterpreter.render_Tj(CSDeviceBasedInterpreter.java:668)&lt;br /&gt;
at de.intarsys.pdf.content.CSInterpreter.process(CSInterpreter.java:199)&lt;br /&gt;
at de.intarsys.pdf.content.CSInterpreter.process(CSInterpreter.java:173)&lt;br /&gt;
... 24 more&lt;/p&gt;
&lt;p&gt;----&lt;/p&gt;
&lt;p&gt;I suspect following code. "/cmap/" to "cmap/"? &lt;/p&gt;
&lt;p&gt;in de.intarsys.pdf.font.NamedCMap.java:64&lt;br /&gt;
----&lt;br /&gt;
static public CMap loadCMap(COSName name) {&lt;br /&gt;
ClassLoader loader = NamedCMap.class.getClassLoader();&lt;br /&gt;
InputStream is = loader.getResourceAsStream("/cmaps/"&lt;br /&gt;
+ name.stringValue() + ".cmap");&lt;br /&gt;
----&lt;/p&gt;
&lt;p&gt;I modifed that code with "cmap/" and tested. it's works fine.&lt;br /&gt;
is it a bug ? or my misunderstanding(i'm not fulltime java programer.please tell me the right way,in this case)&lt;/p&gt;
&lt;p&gt;p.s. using NamedCMap.class.getResourceAsStream works fine, also&lt;/p&gt;
&lt;p&gt;regards.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>