I have attached a patch for podofo for extracting hex strings using
podofotxtextract.
Index: cmake/modules/FindFREETYPE.cmake
===================================================================
--- cmake/modules/FindFREETYPE.cmake (revision 9)
+++ cmake/modules/FindFREETYPE.cmake (revision 14)
@@ -15,12 +15,14 @@
FIND_PATH(FREETYPE_INCLUDE_DIR_FT2BUILD ft2build.h
/usr/include/
/usr/local/include/
+ /usr/X11/include/
NO_CMAKE_SYSTEM_PATH
)
FIND_PATH(FREETYPE_INCLUDE_DIR_FTHEADER freetype/config/ftheader.h
/usr/include/freetype2
/usr/local/include/freetype2
+ /usr/X11/include/freetype2
${FREETYPE_INCLUDE_DIR_FT2BUILD}
${FREETYPE_INCLUDE_DIR_FT2BUILD}/freetype2
NO_CMAKE_SYSTEM_PATH
@@ -41,7 +43,7 @@
SET(FREETYPE_LIBRARY_NAMES_DEBUG ${FREETYPE_LIBRARY_NAMES_DEBUG} freetyped libfreetyped)
SET(FREETYPE_LIBRARY_NAMES_RELEASE ${FREETYPE_LIBRARY_NAMES_RELEASE} freetype libfreetype)
-SET(FREETYPE_LIB_PATHS /usr/lib /usr/local/lib /usr/lib/x86_64-linux-gnu)
+SET(FREETYPE_LIB_PATHS /usr/lib /usr/local/lib /usr/X11/lib /usr/lib/x86_64-linux-gnu)
FIND_LIBRARY(FREETYPE_LIBRARY_RELEASE
${FREETYPE_LIBRARY_NAMES_RELEASE}
Index: src/doc/PdfCMapEncoding.h
===================================================================
--- src/doc/PdfCMapEncoding.h (revision 0)
+++ src/doc/PdfCMapEncoding.h (revision 14)
@@ -0,0 +1,50 @@
+/*
+ *
+ * Pdf CMAP encoding by kalyan
+ *
+ */
+
+
+#ifndef _PDF_CMAP_ENCODING_H
+#define _PDF_CMAP_ENCODING_H
+
+#include "podofo/base/PdfDefines.h"
+#include "podofo/base/PdfEncoding.h"
+#include "PdfElement.h"
+
+
+namespace PoDoFo {
+
+class PODOFO_DOC_API PdfCMapEncoding: public PdfEncoding, private PdfElement{
+ public:
+ enum EBaseEncoding {
+ eBaseEncoding_Font, ///< Use The fonts encoding as base
+ eBaseEncoding_WinAnsi, ///< Use WinAnsiEncoding as base encoding
+ eBaseEncoding_MacRoman, ///< Use MacRomanEncoding as base encoding
+ eBaseEncoding_MacExpert ///< Use MacExpertEncoding as base encoding
+ };
+
+
+ PdfCMapEncoding(PdfObject* pObject);
+ virtual PdfString ConvertToUnicode(const PdfString& rEncodedString, const PdfFont* pFont) const;
+ virtual void AddToDictionary(PdfDictionary & rDictionary ) const;
+ virtual PdfRefCountedBuffer ConvertToEncoding(const PdfString& rString, const PdfFont* pFont) const;
+ virtual bool IsAutoDelete() const;
+ virtual bool IsSingleByteEncoding() const;
+ virtual pdf_utf16be GetCharCode(int nIndex) const;
+ virtual const PdfName & GetID() const;
+ const PdfEncoding* GetBaseEncoding() const;
+ private:
+
+ pdf_utf16be *cMapEncoding;
+ EBaseEncoding m_baseEncoding;
+
+};
+
+}; /*PoDoFo namespace end*/
+
+#endif // _PDF_CMAP_ENCODING_H
+
+
+
+
Index: src/doc/PdfFontFactory.cpp
===================================================================
--- src/doc/PdfFontFactory.cpp (revision 9)
+++ src/doc/PdfFontFactory.cpp (revision 14)
@@ -17,7 +17,7 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#include<iostream>
+
#include "PdfFontFactory.h"
#include "base/PdfDefinesPrivate.h"
@@ -37,7 +37,14 @@
#include "PdfFontType1Base14.h"
#include "PdfFontTrueType.h"
#include "PdfFontFactoryBase14Data.h"
+
+//To be deleted later
+//
+#include <iostream>
+
using namespace std;
+//
+
namespace PoDoFo {
PdfFont* PdfFontFactory::CreateFontObject( PdfFontMetrics* pMetrics, int nFlags,
@@ -48,7 +55,7 @@
EPdfFontType eType = pMetrics->GetFontType();
bool bEmbed = nFlags & ePdfFont_Embedded;
bool bSubsetting = (nFlags & ePdfFont_Subsetting) != 0;
- cout<<"Inside PdfFontFactory"<<endl;
+
try
{
pFont = PdfFontFactory::CreateFontForType( eType, pMetrics, pEncoding, bEmbed, bSubsetting, pParent );
@@ -161,12 +168,13 @@
PdfFont* pFont = NULL;
PdfObject* pDescriptor = NULL;
PdfObject* pEncoding = NULL;
+ PdfObject* pToUnicode = NULL;
if( pObject->GetDictionary().GetKey( PdfName::KeyType )->GetName() != PdfName("Font") )
{
PODOFO_RAISE_ERROR( ePdfError_InvalidDataType );
}
- cout<<"\n INFO: Inside pdf font factory"<<endl;
+
const PdfName & rSubType = pObject->GetDictionary().GetKey( PdfName::KeySubtype )->GetName();
if( rSubType == PdfName("Type0") )
{
@@ -252,34 +260,30 @@
}
else if( rSubType == PdfName("TrueType") )
{
- cout<<"Its a True Type font"<<endl;
pDescriptor = pObject->GetIndirectKey( "FontDescriptor" );
pEncoding = pObject->GetIndirectKey( "Encoding" );
+ pToUnicode = pObject->GetIndirectKey( "ToUnicode" );
- if(!pEncoding)
- {
- cout<<"WARNING: No encoding info provided in object and resetting to Standard Encoding"<<endl;
- }
-
if (pDescriptor ) // OC 18.08.2010: Avoid sigsegv
{
if(pEncoding)
{
- const PdfEncoding* const pPdfEncoding = PdfEncodingObjectFactory::CreateEncoding( pEncoding );
- // OC 15.08.2010 BugFix: Parameter pObject added:
- pMetrics = new PdfFontMetricsObject( pObject, pDescriptor, pPdfEncoding );
- pFont = new PdfFontTrueType( pMetrics, pPdfEncoding, pObject );
+ const PdfEncoding* const pPdfEncoding = PdfEncodingObjectFactory::CreateEncoding( pEncoding );
+
+ // OC 15.08.2010 BugFix: Parameter pObject added:
+ pMetrics = new PdfFontMetricsObject( pObject, pDescriptor, pPdfEncoding );
+ pFont = new PdfFontTrueType( pMetrics, pPdfEncoding, pObject );
}
- else
+
+ if(pToUnicode)
{
- const PdfEncoding* const pPdfEncoding = PdfEncodingFactory::GlobalStandardEncodingInstance();
- // OC 15.08.2010 BugFix: Parameter pObject added:
- pMetrics = new PdfFontMetricsObject( pObject, pDescriptor, pPdfEncoding );
- pFont = new PdfFontTrueType( pMetrics, pPdfEncoding, pObject );
- }
+ const PdfEncoding* const pPdfEncoding = PdfEncodingObjectFactory::CreateEncoding( pToUnicode );
+ // OC 15.08.2010 BugFix: Parameter pObject added:
+ pMetrics = new PdfFontMetricsObject( pObject, pDescriptor, pPdfEncoding );
+ pFont = new PdfFontTrueType( pMetrics, pPdfEncoding, pObject );
-
+ }
}
}
Index: src/doc/PdfEncodingObjectFactory.cpp
===================================================================
--- src/doc/PdfEncodingObjectFactory.cpp (revision 9)
+++ src/doc/PdfEncodingObjectFactory.cpp (revision 14)
@@ -28,44 +28,59 @@
#include "PdfDifferenceEncoding.h"
#include "PdfIdentityEncoding.h"
+#include "PdfCMapEncoding.h"
-namespace PoDoFo {
+//For temporary purpose
-const PdfEncoding* PdfEncodingObjectFactory::CreateEncoding( PdfObject* pObject )
+#include <iostream>
+using namespace std;
+
+namespace PoDoFo
{
- if( pObject->IsReference() )
- {
- // resolve any references
- pObject = pObject->GetOwner()->GetObject( pObject->GetReference() );
- }
- if( pObject->IsName() )
- {
- const PdfName & rName = pObject->GetName();
- if( rName == PdfName("WinAnsiEncoding") )
- return PdfEncodingFactory::GlobalWinAnsiEncodingInstance();
- else if( rName == PdfName("MacRomanEncoding") )
- return PdfEncodingFactory::GlobalMacRomanEncodingInstance();
- else if( rName == PdfName("StandardEncoding") ) // OC 13.08.2010
- return PdfEncodingFactory::GlobalStandardEncodingInstance();
- else if( rName == PdfName("MacExpertEncoding") ) // OC 13.08.2010 TODO solved
- return PdfEncodingFactory::GlobalMacExpertEncodingInstance();
- else if( rName == PdfName("SymbolEncoding") ) // OC 13.08.2010
- return PdfEncodingFactory::GlobalSymbolEncodingInstance();
- else if( rName == PdfName("ZapfDingbatsEncoding") ) // OC 13.08.2010
- return PdfEncodingFactory::GlobalZapfDingbatsEncodingInstance();
- else if( rName == PdfName("Identity-H") )
- return new PdfIdentityEncoding();
- }
- else if( pObject->IsDictionary() )
- {
- return new PdfDifferenceEncoding( pObject );
- }
+ const PdfEncoding *PdfEncodingObjectFactory::CreateEncoding (PdfObject *
+ pObject)
+ {
+ if (pObject->IsReference ())
+ {
+ // resolve any references
+ pObject = pObject->GetOwner ()->GetObject (pObject->GetReference ());
+ }
+ if (pObject->IsName ())
+ {
+ const PdfName & rName = pObject->GetName ();
+ if (rName == PdfName ("WinAnsiEncoding"))
+ return PdfEncodingFactory::GlobalWinAnsiEncodingInstance ();
+ else if (rName == PdfName ("MacRomanEncoding"))
+ return PdfEncodingFactory::GlobalMacRomanEncodingInstance ();
+ else if (rName == PdfName ("StandardEncoding")) // OC 13.08.2010
+ return PdfEncodingFactory::GlobalStandardEncodingInstance ();
+ else if (rName == PdfName ("MacExpertEncoding")) // OC 13.08.2010 TODO solved
+ return PdfEncodingFactory::GlobalMacExpertEncodingInstance ();
+ else if (rName == PdfName ("SymbolEncoding")) // OC 13.08.2010
+ return PdfEncodingFactory::GlobalSymbolEncodingInstance ();
+ else if (rName == PdfName ("ZapfDingbatsEncoding")) // OC 13.08.2010
+ return PdfEncodingFactory::GlobalZapfDingbatsEncodingInstance ();
+ else if (rName == PdfName ("Identity-H"))
+ return new PdfIdentityEncoding ();
+ }
+ else if (pObject->HasStream ()) // Code for /ToUnicode object
+ {
+ return new PdfCMapEncoding(pObject);
+ }
- PODOFO_RAISE_ERROR_INFO( ePdfError_InternalLogic, "Unsupported encoding detected!" );
+ else if (pObject->IsDictionary ())
+ {
+ return new PdfDifferenceEncoding (pObject);
+ }
+
+
+ PODOFO_RAISE_ERROR_INFO (ePdfError_InternalLogic,
+ "Unsupported encoding detected!");
+
//return NULL; Unreachable code
-}
+ }
-}; /* namespace PoDoFo */
+}; /* namespace PoDoFo */
Index: src/doc/PdfCMapEncoding.cpp
===================================================================
--- src/doc/PdfCMapEncoding.cpp (revision 0)
+++ src/doc/PdfCMapEncoding.cpp (revision 14)
@@ -0,0 +1,356 @@
+/*
+ *PdfCMapEncoding by Kalyan
+ *
+ *
+ *
+ */
+
+
+
+#include "PdfCMapEncoding.h"
+#include "base/PdfDefinesPrivate.h"
+#include "base/PdfEncodingFactory.h"
+#include "base/PdfObject.h"
+#include "base/PdfVariant.h"
+#include "base/PdfStream.h"
+#include "base/PdfContentsTokenizer.h"
+
+
+#include <iostream>
+#include <stack>
+#include <iomanip>
+#include <string>
+
+using namespace std;
+
+namespace PoDoFo
+{
+
+
+PdfCMapEncoding::PdfCMapEncoding (PdfObject * pObject) : PdfEncoding(0x0000, 0xffff), PdfElement(NULL, pObject), m_baseEncoding( eBaseEncoding_Font )
+ {
+
+ if(pObject->HasStream())
+ {
+
+ stack < string > stkToken;
+ int loop = 0;
+ char *streamBuffer;
+ const char *streamToken = NULL;
+ EPdfTokenType *streamTokenType = NULL;
+ pdf_long streamBufferLen;
+ bool in_codespacerange = 0;
+ bool in_beginbfrange = 0;
+ bool in_beginbfchar = 0;
+ int code_space_entries = 0;
+ int range_entries = 0;
+ int char_entries = 0;
+ int inside_hex_string = 0;
+ int inside_array = 0;
+ int range_start;
+ int range_end;
+ int i = 0;
+ int firstvalue = 0;
+ pair < long, long >encodingRange;
+ const PdfStream *CIDStreamdata = pObject->GetStream ();
+ CIDStreamdata->GetFilteredCopy (&streamBuffer, &streamBufferLen);
+ const PdfEncoding* const test_encoding = PdfEncodingFactory::GlobalStandardEncodingInstance();
+
+ PdfContentsTokenizer streamTokenizer (streamBuffer, streamBufferLen);
+ while (streamTokenizer.GetNextToken (streamToken, streamTokenType))
+ {
+ stkToken.push (streamToken);
+
+ if (strcmp (streamToken, ">") == 0)
+ {
+ if (inside_hex_string == 0)
+ cout << "\n Pdf Error, got > before <";
+ else
+ inside_hex_string = 0;
+
+ i++;
+
+ }
+
+ if (strcmp (streamToken, "]") == 0)
+ {
+ if (inside_array == 0)
+ cout << "\n Pdf Error, got ] before [";
+ else
+ inside_array = 0;
+
+ i++;
+
+ }
+
+
+ if (in_codespacerange == 1)
+ {
+ if (loop < code_space_entries)
+ {
+ if (inside_hex_string == 1)
+ {
+ unsigned int num_value;
+ std::stringstream ss;
+ ss << std::hex << streamToken;
+ ss >> num_value;
+ if (i % 2 == 0)
+ {
+ encodingRange.first = num_value;
+ }
+ if (i % 2 == 1)
+ {
+ encodingRange.second = num_value;
+ loop++;
+ }
+
+
+
+ }
+
+ }
+
+ }
+
+
+
+ if (in_beginbfrange == 1)
+ {
+ if (loop < range_entries)
+ {
+ if (inside_hex_string == 1)
+ {
+ unsigned int num_value;
+ std::stringstream ss;
+ ss << std::hex << streamToken;
+ ss >> num_value;
+ if (i % 3 == 0)
+ range_start = num_value;
+ if (i % 3 == 1)
+ {
+ range_end = num_value;
+ }
+ if (i % 3 == 2)
+ {
+ for (int k = range_start; k < range_end; k++)
+ {
+ *(cMapEncoding + k) = num_value;
+ num_value++;
+ }
+
+ loop++;
+
+ }
+ }
+ }
+
+ }
+
+
+
+ if (in_beginbfchar == 1)
+ {
+ if (loop < char_entries)
+ {
+ if (inside_hex_string == 1)
+ {
+ unsigned int num_value;
+ std::stringstream ss;
+ ss << std::hex << streamToken;
+ ss >> num_value;
+ if (i % 2 == 0)
+ {
+ firstvalue = num_value;
+ }
+ if (i % 2 == 1)
+ {
+ if (encodingRange.first <= num_value && num_value <= encodingRange.second)
+ *(cMapEncoding + firstvalue-1) = num_value;
+ else
+ cout << "\n Error ... Value out of range" << endl;
+ }
+
+ }
+
+ }
+
+ }
+
+
+ if (strcmp (streamToken, "<") == 0)
+ {
+ inside_hex_string = 1;
+ }
+
+
+
+ if (strcmp (streamToken, "[") == 0)
+ {
+ inside_array = 1;
+ }
+
+
+
+
+
+ if (strcmp (streamToken, "begincodespacerange") == 0)
+ {
+ in_codespacerange = 1;
+ stkToken.pop ();
+ std::stringstream ss;
+ ss << std::hex << stkToken.top ();
+ ss >> code_space_entries;
+ }
+
+ if (strcmp (streamToken, "endcodespacerange") == 0)
+ {
+ if (in_codespacerange == 0)
+ cout <<
+ "\nError in pdf document got endcodespacerange before begincodespacerange";
+ in_codespacerange = 0;
+ cMapEncoding = static_cast <pdf_utf16be *>(calloc((encodingRange.second - encodingRange.first + 1), sizeof(pdf_utf16be)));
+ i = 0;
+ }
+
+ if (strcmp (streamToken, "beginbfrange") == 0)
+ {
+ in_beginbfrange = 1;
+ stkToken.pop ();
+ std::stringstream ss;
+ ss << std::hex << stkToken.top ();
+ ss >> range_entries;
+
+ }
+
+ if (strcmp (streamToken, "endbfrange") == 0)
+ {
+ in_beginbfrange = 0;
+ i = 0;
+ }
+
+ if (strcmp (streamToken, "beginbfchar") == 0)
+ {
+ in_beginbfchar = 1;
+ stkToken.pop ();
+ std::stringstream ss;
+ ss << std::hex << stkToken.top ();
+ ss >> char_entries;
+
+ }
+
+ if (strcmp (streamToken, "endbfchar") == 0)
+ {
+ in_beginbfchar = 0;
+ i = 0;
+ }
+
+
+
+ }
+
+ *(cMapEncoding + encodingRange.second-1) = NULL;
+ }
+
+
+}
+
+
+
+void PdfCMapEncoding::AddToDictionary(PdfDictionary & rDictionary) const
+{
+
+
+
+}
+
+const PdfEncoding* PdfCMapEncoding::GetBaseEncoding() const
+{
+ const PdfEncoding* pEncoding = NULL;
+
+ switch( m_baseEncoding )
+ {
+ case eBaseEncoding_WinAnsi:
+ pEncoding = PdfEncodingFactory::GlobalWinAnsiEncodingInstance();
+ break;
+
+ case eBaseEncoding_MacRoman:
+ pEncoding = PdfEncodingFactory::GlobalMacRomanEncodingInstance();
+ break;
+
+ case eBaseEncoding_MacExpert:
+ case eBaseEncoding_Font:
+ default:
+ break;
+ }
+
+ if( !pEncoding )
+ {
+ PODOFO_RAISE_ERROR( ePdfError_InvalidHandle );
+ }
+
+ return pEncoding;
+}
+
+PdfString PdfCMapEncoding::ConvertToUnicode(const PdfString & rEncodedString, const PdfFont* pFont) const
+{
+
+ const PdfEncoding* const pEncoding = PdfEncodingFactory::GlobalPdfDocEncodingInstance();
+ if(rEncodedString.IsHex())
+ {
+ PdfString PdfUnicodeString = rEncodedString.ToUnicode();
+ char * ptrHexString = static_cast<char *>( malloc( sizeof(char) * (rEncodedString.GetLength() + 2 ) ) );
+ pdf_utf16be* pszUtf16 = static_cast<pdf_utf16be*>(malloc(sizeof(pdf_utf16be)*rEncodedString.GetLength()));
+ memcpy( ptrHexString, rEncodedString.GetString(), rEncodedString.GetLength() );
+ for ( int strIndex = 0; strIndex < static_cast<int>(rEncodedString.GetLength()); strIndex++ )
+ {
+ *(pszUtf16 + strIndex) = pEncoding->GetCharCode(*(cMapEncoding + static_cast<int>(ptrHexString[strIndex]) -1));
+ }
+ PdfString ret(pszUtf16, rEncodedString.GetLength());
+ free( ptrHexString );
+ free( pszUtf16 );
+ return ret;
+ }
+ else
+ {
+
+ return(PdfString("\0"));
+ }
+}
+
+PdfRefCountedBuffer PdfCMapEncoding::ConvertToEncoding(const PdfString &rEncodedString, const PdfFont* pFont) const
+{
+
+
+}
+
+
+bool PdfCMapEncoding::IsSingleByteEncoding() const
+{
+
+ return false;
+
+}
+
+
+bool PdfCMapEncoding::IsAutoDelete() const
+{
+
+
+}
+
+
+pdf_utf16be PdfCMapEncoding::GetCharCode(int nIndex) const
+{
+
+
+}
+
+
+const PdfName & PdfCMapEncoding::GetID() const
+{
+
+
+}
+
+
+};
Index: src/doc/PdfFontCache.cpp
===================================================================
--- src/doc/PdfFontCache.cpp (revision 9)
+++ src/doc/PdfFontCache.cpp (revision 14)
@@ -35,7 +35,7 @@
#include "PdfFontType1.h"
#include <algorithm>
-#include <iostream>
+
#ifdef _WIN32
//#include <windows.h>
@@ -362,14 +362,11 @@
PdfFont* PdfFontCache::GetFont( PdfObject* pObject )
{
TCISortedFontList it = m_vecFonts.begin();
- const PdfReference & ref = pObject->Reference();
+ const PdfReference & ref = pObject->Reference();
- cout<<"\n Entering font search function";
-
// Search if the object is a cached normal font
while( it != m_vecFonts.end() )
{
- cout<<"\n Searching for font";
if( (*it).m_pFont->GetObject()->Reference() == ref )
return (*it).m_pFont;
@@ -380,7 +377,6 @@
it = m_vecFontSubsets.begin();
while( it != m_vecFontSubsets.end() )
{
- cout<<"\n Searching for font subset";
if( (*it).m_pFont->GetObject()->Reference() == ref )
return (*it).m_pFont;
@@ -388,7 +384,6 @@
}
// Create a new font
- cout<<"\n Creating new font inside font cache"<<endl;
PdfFont* pFont = PdfFontFactory::CreateFont( &m_ftLibrary, pObject );
if( pFont )
{
@@ -398,14 +393,11 @@
element.m_bItalic = pFont->IsItalic();
element.m_sFontName = pFont->GetFontMetrics()->GetFontname();
element.m_pEncoding = NULL;
- m_vecFonts.push_back( element );
+ m_vecFonts .push_back( element );
// Now sort the font list
std::sort( m_vecFonts.begin(), m_vecFonts.end() );
}
- else
- cout<<"WARNING: Font object not created inside PdfFontCache"<<endl;
-
return pFont;
}
@@ -574,7 +566,7 @@
element.m_bItalic = newFont->IsItalic();
element.m_sFontName = name;
element.m_pEncoding = newFont->GetEncoding();
- m_vecFonts.push_back( element );
+ m_vecFonts .push_back( element );
// Now sort the font list
std::sort( m_vecFonts.begin(), m_vecFonts.end() );
Index: src/CMakeLists.txt
===================================================================
--- src/CMakeLists.txt (revision 9)
+++ src/CMakeLists.txt (revision 14)
@@ -98,6 +98,7 @@
doc/PdfStreamedDocument.cpp
doc/PdfTable.cpp
doc/PdfXObject.cpp
+ doc/PdfCMapEncoding.cpp
)
IF(WIN32)
@@ -216,6 +217,7 @@
doc/PdfStreamedDocument.h
doc/PdfTable.h
doc/PdfXObject.h
+ doc/PdfCMapEncoding.h
)
# Create a Source Group for Visual Studio
Index: tools/podofotxtextract/TextExtractor.cpp
===================================================================
--- tools/podofotxtextract/TextExtractor.cpp (revision 9)
+++ tools/podofotxtextract/TextExtractor.cpp (revision 14)
@@ -132,7 +132,7 @@
for( int i=0; i<static_cast<int>(array.GetSize()); i++ )
{
- if( array[i].IsString() )
+ if( array[i].IsString() || array[i].IsHexString() )
AddTextElement( dCurPosX, dCurPosY, pCurFont, array[i].GetString() );
}
}
@@ -151,7 +151,7 @@
}
void TextExtractor::AddTextElement( double dCurPosX, double dCurPosY,
- PdfFont* pCurFont, const PdfString & rString )
+ PdfFont* pCurFont, const PdfString & rString )
{
if( !pCurFont )
{
@@ -169,10 +169,8 @@
PdfString unicode = pCurFont->GetEncoding()->ConvertToUnicode( rString, pCurFont );
const char* pszData = unicode.GetStringUtf8().c_str();
while( *pszData ) {
- printf("%02x", static_cast<unsigned char>(*pszData) );
+ //printf("%02x", static_cast<unsigned char>(*pszData) );
++pszData;
}
- printf("\n");
-
- printf("(%.3f,%.3f) %s \n", dCurPosX, dCurPosY, unicode.GetStringUtf8().c_str() );
+ printf("(%.3f,%.3f) %s \n", dCurPosX, dCurPosY, unicode.GetStringUtf8().c_str() );
}
Index: tools/podofopdfinfo/pdfinfo.h
===================================================================
--- tools/podofopdfinfo/pdfinfo.h (revision 9)
+++ tools/podofopdfinfo/pdfinfo.h (revision 14)
@@ -22,7 +22,7 @@
#define _PDFINFO_H_
#include <ostream>
-#include <podofo/podofo.h>
+#include <podofo.h>
class PdfInfo {
public:
Index: README.html
===================================================================
--- README.html (revision 9)
+++ README.html (revision 14)
@@ -21,6 +21,7 @@
<ol>
<li><a href="#cmake_builds_on_linux_unix">CMake builds on Linux/UNIX</a></li>
<li><a href="#cmake_builds_on_mac_os_x">CMake builds on Mac OS X</a></li>
+ <li><a href="#homebrew_builds_on_macos">Homebrew builds on Mac OS X</a></li>
<li><a href="#cmake_builds_on_windows">CMake builds on Windows</a></li>
</ol>
</li>
@@ -167,6 +168,7 @@
with Makefiles, or may generate an XCode project with CMake. See the <a href="#cmake_builds_on_mac_os_x">Mac OS X
section</a> below, and the <a href="#installation_with_cmake">generic instructions for cmake builds</a></p>
+
<h3><a name="stlport_support" />STLPort support</h3>
<p>Don't know what STLPort is? Ignore it and skip this section. Packagers should
@@ -343,6 +345,20 @@
<p>change "Unix Makefiles" to "Xcode" if you want to build an XCode project instead, then
instead of running `make' and `make install' just open the project file and work as normal</p>
+<h4><a name="homebrew_builds_on_macos" />Homebrew builds on Mac OS X</h4>
+
+<p>For Homebrew (package manager for Mac OS X) it is quite simple to install podofo. Freetype2 and zlib should be installed on Mac OS X by default.
+<pre>
+brew install fontconfig
+brew install libjpeg
+brew install libtiff
+cd ((directory of podofo))
+cmake -G "Unix Makefiles"
+make
+make install
+</pre>
+</p>
+
<h4><a name="cmake_builds_on_windows" />CMake builds on Windows</h4>
<h5><a name="windows_dependencies"/>Windows Dependencies</h5>
Index: examples/pdfcontentsgraph/main.cpp
===================================================================
--- examples/pdfcontentsgraph/main.cpp (revision 9)
+++ examples/pdfcontentsgraph/main.cpp (revision 14)
@@ -1,4 +1,4 @@
-#include "podofo/podofo.h"
+#include "podofo.h"
#include "PdfContentsGraph.h"
#include <iostream>
@@ -80,7 +80,7 @@
PODOFO_RAISE_LOGIC_IF( !page, "Got null page pointer within valid page range" );
PdfContentsTokenizer tokenizer( page );
-// PdfContentsGraph grapher( tokenizer );
+ PdfContentsGraph grapher( tokenizer );
cout << " - page ok" << endl;
}
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users