I ran podofouncompress over the attached simple file, but I get an error in PdfFlateFilter::BeginDecodeImpl.

If I look at m_stream, I see bad pointers in next_in, next_out and msg. Data type is -842150451.

Any help greatly appreciated.

Ed.

-----------------------------------------------------

Console

C:\dev\pdf\podofo\tools\podofouncompress\debug>podofouncompress example.pdf exam
pleu.pdf
-> Uncompressing object 2 0
-> Original Length: 131
Assertion failed: !m_pOutputStream, file c:\dev\pdf\podofo-0.5.0\src\PdfFilter.h
, line 377

-----------------------------------------------------
m_stream settings

-        &m_stream    0x01384810 {next_in=0xcdcdcdcd <Bad Ptr> avail_in=3452816845 total_in=3452816845 ...}    z_stream_s *
+        next_in    0xcdcdcdcd <Bad Ptr>    unsigned char *
        avail_in    3452816845    unsigned int
        total_in    3452816845    unsigned long
+        next_out    0xcdcdcdcd <Bad Ptr>    unsigned char *
        avail_out    3452816845    unsigned int
        total_out    3452816845    unsigned long
+        msg    0xcdcdcdcd <Bad Ptr>    char *
+        state    0xcdcdcdcd {dummy=??? }    internal_state *
        zalloc    0x00000000    void * (void *, unsigned int, unsigned int)*
        zfree    0x00000000    void (void *, void *)*
        opaque    0x00000000    void *
        data_type    -842150451    int
        adler    3452816845    unsigned long
        reserved    3452816845    unsigned long
-        &m_stream    0x01384810 {next_in=0xcdcdcdcd <Bad Ptr> avail_in=3452816845 total_in=3452816845 ...}    z_stream_s *
+        next_in    0xcdcdcdcd <Bad Ptr>    unsigned char *
        avail_in    3452816845    unsigned int
        total_in    3452816845    unsigned long
+        next_out    0xcdcdcdcd <Bad Ptr>    unsigned char *
        avail_out    3452816845    unsigned int
        total_out    3452816845    unsigned long
+        msg    0xcdcdcdcd <Bad Ptr>    char *
+        state    0xcdcdcdcd {dummy=??? }    internal_state *
        zalloc    0x00000000    void * (void *, unsigned int, unsigned int)*
        zfree    0x00000000    void (void *, void *)*
        opaque    0x00000000    void *
        data_type    -842150451    int
        adler    3452816845    unsigned long
        reserved    3452816845    unsigned long

----------------------------------------------------------------

Call Stack

>    podofo.dll!PoDoFo::PdfFlateFilter::BeginDecodeImpl(const PoDoFo::PdfDictionary * pDecodeParms=0x0135bed0)  Line 472    C++
     podofo.dll!PoDoFo::PdfFilter::BeginDecode(PoDoFo::PdfOutputStream * pOutput=0x00d9fc98, const PoDoFo::PdfDictionary * pDecodeParms=0x0135bed0)  Line 335 + 0x13 bytes    C++
     podofo.dll!PoDoFo::PdfFilteredDecodeStream::PdfFilteredDecodeStream(PoDoFo::PdfOutputStream * pOutputStream=0x00d9fc98, PoDoFo::EPdfFilter eFilter=ePdfFilter_FlateDecode, bool bOwnStream=false, const PoDoFo::PdfDictionary * pDecodeParms=0x0135bed0)  Line 143    C++
     podofo.dll!PoDoFo::PdfFilterFactory::CreateDecodeStream(const std::vector<enum PoDoFo::EPdfFilter,std::allocator<enum PoDoFo::EPdfFilter> > & filters=[1](ePdfFilter_FlateDecode), PoDoFo::PdfOutputStream * pStream=0x00d9fc98, const PoDoFo::PdfDictionary * pDictionary=0x0135bed0)  Line 289 + 0x3d bytes    C++
     podofo.dll!PoDoFo::PdfStream::GetFilteredCopy(char * * ppBuffer=0x00d9fd6c, long * lLen=0x00d9fd78)  Line 70 + 0x31 bytes    C++
     podofo.dll!PoDoFo::PdfMemStream::Uncompress()  Line 221    C++
     podofouncompress.exe!UnCompress::UncompressObjects()  Line 60 + 0xb bytes    C++
     podofouncompress.exe!UnCompress::Init(const char * pszInput=0x013569ac, const char * pszOutput=0x013569b8)  Line 42    C++
     podofouncompress.exe!main(int argc=3, char * * argv=0x01356958)  Line 55 + 0x10 bytes    C++
     podofouncompress.exe!__tmainCRTStartup()  Line 597 + 0x19 bytes    C
     podofouncompress.exe!mainCRTStartup()  Line 414    C


-----------------------------------------------------

Visual Studio Output

'podofouncompress.exe': Loaded 'C:\dev\pdf\podofo\tools\podofouncompress\debug\podofouncompress.exe', Symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\wxvault.dll', Binary was not built with debug information.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\psapi.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\mpr.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\user32.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\version.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\detoured.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\shell32.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\dev\pdf\podofo\tools\podofouncompress\debug\podofo.dll', Symbols loaded.
'podofouncompress.exe': Loaded 'C:\dev\pdf\podofo\tools\podofouncompress\debug\zlib1.dll', Binary was not built with debug information.
'podofouncompress.exe': Loaded 'C:\dev\pdf\podofo\tools\podofouncompress\debug\freetype6.dll', Binary was not built with debug information.
'podofouncompress.exe': Loaded 'C:\dev\pdf\podofo\tools\podofouncompress\debug\jpeg62.dll', Binary was not built with debug information.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\ws2_32.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\ws2help.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f\msvcp80d.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f\msvcr80d.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\Program Files\Google\Google Desktop Search\GoogleDesktopNetwork3.dll', No symbols loaded.
'podofouncompress.exe': Unloaded 'C:\Program Files\Google\Google Desktop Search\GoogleDesktopNetwork3.dll'
'podofouncompress.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll', No symbols loaded.
First-chance exception at 0x00000000 in podofouncompress.exe: 0xC0000005: Access violation reading location 0x00000000.
First-chance exception at 0x7c812a5b in podofouncompress.exe: Microsoft C++ exception: PoDoFo::PdfError at memory location 0x00d9f88c..
First-chance exception at 0x7c812a5b in podofouncompress.exe: Microsoft C++ exception: PoDoFo::PdfError at memory location 0x00d9f7a0..
First-chance exception at 0x7c812a5b in podofouncompress.exe: Microsoft C++ exception: PoDoFo::PdfError at memory location 0x00d9fa40..
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\MSCTF.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\oleaut32.dll', No symbols loaded.
'podofouncompress.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', No symbols loaded.
The program '[4944] podofouncompress.exe: Native' has exited with code 3 (0x3).

-----------------------------------------------------


Edward Ross wrote:
Hi Craig,

Now I'm making some progress - thanks for the help.

Just to clarify I understood that the idea of cmake is to make the project files for Visual Studio.  But I thought that cmake was part of MinGW (like the unix tools that run under cygwin).  Having the cmake.org URL in the readme would be useful for newbies to the cmake and mingw like me to get going.

I also find the revised form of this paragraph very clear:
"If your application or library uses Visual Studio, CMake can be used to
build a Visual Studio project you can use. Alternately, if you are using
MinGW for your existing code, CMake can make you a MinGW makefile to
build a mingw compatible version of PoDoFo."
I've installed freetype and zlib from gnuwin32, and run cmake.  But it can't find freetype.lib - which is missing from c:\program files\gnuwin32\lib.  The output from cmake is below.  I tried downloading the freetype-2.3.5 sources, creating a visual studio project with jam and then copying the freetype235MT.lib into the gnuwin32 folder as freetype.lib.  This allowed the cmake project generation to complete - but visual studio can't link against the freetype lib.

Do you know where I could get a working freetype lib from or what settings I should use to compile freetype correctly?

Many thanks,

Ed.

------------------------------------------------------------

C:\dev\pdf\podofo>cmake -G "Visual Studio 8 2005" ..\podofo-0.5.0 -DCMAKE_INCLUD
E_PATH=C:\progra~1\gnuwin32\include -DCMAKE_LIBRARY_PATH=c:\progra~1\gnuwin32\li
b
-- Check for working C compiler: cl
-- Check for working C compiler: cl -- works
-- Check size of void*
-- Check size of void* - done
-- Check for working CXX compiler: cl
-- Check for working CXX compiler: cl -- works
Both PODOFO_BUILD_SHARED and PODOFO_BUILD_STATIC set
  so disabling static library generation (CMake version < 2.5)
Found zlib headers in C:/progra~1/gnuwin32/include, library at C:/Program Files/
GnuWin32/lib/zlib.lib
Found libjpeg headers in C:/progra~1/gnuwin32/include, library at C:/Program Fil
es/GnuWin32/lib/jpeg.lib
Found ft2build.h in C:/progra~1/gnuwin32/include
Found freetype/config/ftheader.h in C:/progra~1/gnuwin32/include/freetype2
Found freetype library at LIBFREETYPE_LIB-NOTFOUND
Found freetype library at LIBFREETYPE_LIB-NOTFOUND
Found STLPort headers in LIBSTLPORT_HEADERS-NOTFOUND
Found STLPort library in LIBSTLPORT_LIB-NOTFOUND
Found fontconfig.h at LIBFONTCONFIG_H-NOTFOUND/fontconfig/fontconfig.h
Found fontconfig library at LIBFONTCONFIG_LIB-NOTFOUND
Building shared PoDoFo library
PDEBUG: USING_SHARED_PODOFO: TRUE
PDEBUG: PODOFO_DEPEND_TARGET: podofo_shared
CMake Error: This project requires some variables to be set,
and cmake can not find them.
Please set the following variables:
LIBFREETYPE_LIB

-- Configuring done

------------------------------------------------------------

1>------ Build started: Project: podofo_shared, Configuration: Debug Win32 ------
1>Linking...
1>   Creating library Debug\podofo.lib and object Debug\podofo.exp
1>PdfFontCache.obj : error LNK2019: unresolved external symbol __imp__FT_Init_FreeType referenced in function "public: __thiscall PoDoFo::PdfFontCache::PdfFontCache(class PoDoFo::PdfVecObjects *)" ([EMAIL PROTECTED]@@[EMAIL PROTECTED]@1@@Z)
1>PdfFontCache.obj : error LNK2019: unresolved external symbol __imp__FT_Done_FreeType referenced in function "public: __thiscall PoDoFo::PdfFontCache::~PdfFontCache(void)" ([EMAIL PROTECTED]@@[EMAIL PROTECTED])
1>PdfFontCache.obj : error LNK2019: unresolved external symbol __imp__FT_Get_Postscript_Name referenced in function "public: class PoDoFo::PdfFont * __thiscall PoDoFo::PdfFontCache::GetFont(struct FT_FaceRec_ *,bool)" ([EMAIL PROTECTED]@PoDoFo@@[EMAIL PROTECTED]@PAUFT_FaceRec_@@[EMAIL PROTECTED])
1>PdfFontMetrics.obj : error LNK2001: unresolved external symbol __imp__FT_Get_Postscript_Name
1>PdfFontMetrics.obj : error LNK2019: unresolved external symbol __imp__FT_New_Memory_Face referenced in function "public: __thiscall PoDoFo::PdfFontMetrics::PdfFontMetrics(struct FT_LibraryRec_ * *,char const *)" ([EMAIL PROTECTED]@@[EMAIL PROTECTED]@@[EMAIL PROTECTED])
1>PdfFontMetrics.obj : error LNK2019: unresolved external symbol __imp__FT_New_Face referenced in function "public: __thiscall PoDoFo::PdfFontMetrics::PdfFontMetrics(struct FT_LibraryRec_ * *,char const *)" ([EMAIL PROTECTED]@@[EMAIL PROTECTED]@@[EMAIL PROTECTED])
1>PdfFontMetrics.obj : error LNK2019: unresolved external symbol __imp__FT_Done_Face referenced in function "public: virtual __thiscall PoDoFo::PdfFontMetrics::~PdfFontMetrics(void)" ([EMAIL PROTECTED]@@[EMAIL PROTECTED])
1>PdfFontMetrics.obj : error LNK2019: unresolved external symbol __imp__FT_Load_Char referenced in function "private: void __thiscall PoDoFo::PdfFontMetrics::InitFromFace(void)" ([EMAIL PROTECTED]@PoDoFo@@AAEXXZ)
1>PdfFontMetrics.obj : error LNK2019: unresolved external symbol __imp__FT_Set_Char_Size referenced in function "public: void __thiscall PoDoFo::PdfFontMetrics::SetFontSize(float)" ([EMAIL PROTECTED]@PoDoFo@@[EMAIL PROTECTED])
1>Debug\podofo.dll : fatal error LNK1120: 8 unresolved externals
1>Build log was saved at "file://c:\dev\pdf\podofo\src\podofo_shared.dir\Debug\BuildLog.htm"
1>podofo_shared - 10 error(s), 0 warning(s)
2>------ Build started: Project: podofouncompress, Configuration: Debug Win32 ------
2>Linking...
2>Embedding manifest...
2>Build log was saved at "file://c:\dev\pdf\podofo\tools\podofouncompress\podofouncompress.dir\Debug\BuildLog.htm"
2>podofouncompress - 0 error(s), 0 warning(s)
========== Build: 1 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========



Craig Ringer wrote:
Edward Ross wrote:
  
 Many thanks for the information.  I'm completely unfamiliar with mingw
and cmake.  I've downloaded and installed and installed mingw, but I
can't find cmake - could you let me know where I can get cmake for mingw
please?
    

You do not need MinGW - you can and probably should use Visual Studio if
you're used to it and prefer it. Remember that C++ code is not binary
compatible between different compilers, so if you build your main app
with Visual Studio 6 you must also build PoDoFo with Visual Studio 6, as
explained in the "CMake builds with Windows" section of the README.

As for CMake - there's no "CMake for Visual Studio". CMake is standalone
and targets a variety of tools on each platform. I have failed to
document installing CMake as part of the PoDoFo install instructions -
partly because it's amazingly easy.

Go to cmake.org
Download the current CMake binary release
Install it

You're done. It auto-detects MinGW, various Visual Studio versions, etc;
no further setup should be required.

  
Looking at the install instructions - I've tried the provided VS project
files route already.  So I guess I'll now try generating Visual Studio
project files with CMake.  But I'm a little confused by the second
sentence  - are MinGW Makefiles the same thing as using CMake to
generate Visual Studio project files?
    

No. MinGW is completely different to Visual Studio - it's a port of the
GNU C/C++ compiler to Windows.

The instructions cover several ways to build on Windows, because Windows
developers use a variety of tools and work in a variety of ways. In your
case, you want to use CMake to generate Visual Studio project files. You
don't need to have anything to do with MinGW.

  
"On Windows, it is recommended that you use CMake to generate Visual Studio
project files appropriate for your VS version and your libraries. You
can also generate NMake builds or MinGW Makefiles (see "Installation with CMake").
    

Read "CMake builds on Windows" and "CMake builds on Windows with Visual
Studio" in the README. If anything is still unclear, let me know.

The point above could perhaps be more explicitly stated as:

"If your application or library uses Visual Studio, CMake can be used to
build a Visual Studio project you can use. Alternately, if you are using
MinGW for your existing code, CMake can make you a MinGW makefile to
build a mingw compatible version of PoDoFo."

  
Alternately, Windows users can use the provided Visual Studio
Solution/Project
files after placing the other libraries in a directory inside of the podofo
directory."
    

Yep, that's hopelessly out of date and has been removed from the current
development version, along with the project file referred to.

--
Craig Ringer


  


-- 

Edward Ross
Exorbyte GmbH
UK Office: +44 (0)845 6800061
DE Office: +49 (0)7531 3633900
Fax: +44 (0)845 6800062
http://www.exorbyte.com

------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________ Podofo-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/podofo-users


-- 

Edward Ross
Exorbyte GmbH
UK Office: +44 (0)845 6800061
DE Office: +49 (0)7531 3633900
Fax: +44 (0)845 6800062
http://www.exorbyte.com

Attachment: example.pdf
Description: Adobe PDF document

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Podofo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to