Odpowiedz 
 
Ocena wątku:
  • 0 Głosów - 0 Średnio
  • 1
  • 2
  • 3
  • 4
  • 5
jak skompilować pdf2xml?
Autor Wiadomość
dulaman Offline
antyfan mikroszitu

Liczba postów: 92
Dołączył: 21-12-2009
Reputacja: 0
Post: #1
jak skompilować pdf2xml?
Witam! Postanowiłem przerobić kilka ebooków tak aby działały na moim telefonie. Jednyny niepłatny program jaki znalazłem do konwertowania plików pdf to opensource'owy i windowsowy program PDF2XML. Ściągnąłem ten program ze strony tego projektu http://www.mobipocket.com/dev/pdf2xml/ (link do kodu źródłowego znajduje się na końcu strony), nie wiem jednak jak go skompilować jest to wyłącznie kod źródłowy c++, a ja jeszcze nigdy nie pisałem programów c++ (znam tylko pascal i bash), byłbym wdzięczny z każdą pomoc.

Po wpisaniu ls, w katalogu pdf2xml, wyskakuje:
Kod:
image  pdf2xml.cpp  pdf2xml.h  xpdf
07.07.2010 17:10:25
Odwiedź stronę użytkownika Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
Barthalion Offline
NIE MA MENU
******

Liczba postów: 1 029
Dołączył: 25-01-2009
Reputacja: 20
Post: #2
RE: jak skompilować pdf2xml?
Cytat:Compiling pdf2xml
Linking to a specific location of another ebook

Download the zipped sources. Unzip all files.

You probably want to define the two macros PNG_NO_READ_SUPPORTED and PNG_NO_MNG_FEATURES using -D or /D compiler options tho minimize the code generated by the pnglib.

You have to add the following include paths using -I or /I compiler options:

./xpdf
./xpdf/fofi
./xpdf/goo
./xpdf/xpdf
./image/zlib
./image/png

Once that is setup, simply compile and link all cpp files.

You may also want to download the latest version of xpdf and libpng to compile pxdf2xml.cpp against them

Zamiast uczyć się języków programowania zacznij od czytania całych stron projektów, a nie szukania plików do pobrania.

Google nigdy nie powie Ci: nie mam czasu, było, użyj szukajki, Google, RTFM, STFU
07.07.2010 17:27:13
Odwiedź stronę użytkownika Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
dulaman Offline
antyfan mikroszitu

Liczba postów: 92
Dołączył: 21-12-2009
Reputacja: 0
Post: #3
RE: jak skompilować pdf2xml?
Ja w ogóle nie umiem kompilować plików *.cpp, przydałoby się konkretne polecenie. Ja nawet nie wiem którego kompilatora mam użyć.
07.07.2010 17:41:36
Odwiedź stronę użytkownika Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
Barthalion Offline
NIE MA MENU
******

Liczba postów: 1 029
Dołączył: 25-01-2009
Reputacja: 20
Post: #4
RE: jak skompilować pdf2xml?

Google nigdy nie powie Ci: nie mam czasu, było, użyj szukajki, Google, RTFM, STFU
07.07.2010 18:00:30
Odwiedź stronę użytkownika Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
Piotrek23 Offline
Moderator Globalny
******

Liczba postów: 479
Dołączył: 13-12-2008
Reputacja: 7
Post: #5
RE: jak skompilować pdf2xml?
Spróbuj:
Kod:
g++ -o pdf2xml pdf2xml.cpp

[Obrazek: z1b9b.png]
07.07.2010 18:02:30
Odwiedź stronę użytkownika Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
dulaman Offline
antyfan mikroszitu

Liczba postów: 92
Dołączył: 21-12-2009
Reputacja: 0
Post: #6
RE: jak skompilować pdf2xml?
Kod:
~/zrodla/pdf2xml> g++ -o pdf2xml pdf2xml.cpp
In file included from pdf2xml.cpp:9:
pdf2xml.h:39:19: error: GList.h: Nie ma takiego pliku ani katalogu
pdf2xml.h:40:20: error: PDFDoc.h: Nie ma takiego pliku ani katalogu
pdf2xml.h:41:23: error: OutputDev.h: Nie ma takiego pliku ani katalogu
pdf2xml.h:44:17: error: png.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:15:21: error: GString.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:16:18: error: gmem.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:19:26: error: GlobalParams.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:20:20: error: Object.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:21:20: error: Stream.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:22:19: error: Array.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:23:18: error: Dict.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:24:18: error: XRef.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:25:21: error: Catalog.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:26:18: error: Page.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:27:18: error: Link.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:28:22: error: GfxState.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:29:21: error: GfxFont.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:30:23: error: CharTypes.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:31:24: error: UnicodeMap.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:32:18: error: UTF8.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:33:19: error: Error.h: Nie ma takiego pliku ani katalogu
pdf2xml.cpp:34:20: error: config.h: Nie ma takiego pliku ani katalogu
In file included from pdf2xml.cpp:9:
pdf2xml.h:95: error: ‘GString’ has not been declared
pdf2xml.h:102: error: ‘GString’ has not been declared
pdf2xml.h:102: error: ‘GString’ has not been declared
pdf2xml.h:108: error: ‘GString’ has not been declared
pdf2xml.h:115: error: ‘GString’ has not been declared
pdf2xml.h:121: error: ‘GString’ has not been declared
pdf2xml.h:126: error: ‘GString’ has not been declared
pdf2xml.h:131: error: ‘GString’ has not been declared
pdf2xml.h:136: error: ISO C++ forbids declaration of ‘FILE’ with no type
pdf2xml.h:136: error: expected ‘;’ before ‘*’ token
pdf2xml.h:147: error: expected class-name before ‘{’ token
pdf2xml.h:150: error: ‘GString’ has not been declared
pdf2xml.h:159: error: ‘GBool’ does not name a type
pdf2xml.h:162: error: ‘GBool’ does not name a type
pdf2xml.h:166: error: ‘GBool’ does not name a type
pdf2xml.h:169: error: ‘GBool’ does not name a type
pdf2xml.h:172: error: ‘GfxState’ has not been declared
pdf2xml.h:172: error: ‘Object’ has not been declared
pdf2xml.h:172: error: ‘Stream’ has not been declared
pdf2xml.h:173: error: ‘GBool’ has not been declared
pdf2xml.h:174: error: ‘GBool’ has not been declared
pdf2xml.h:175: error: ‘GfxState’ has not been declared
pdf2xml.h:175: error: ‘Object’ has not been declared
pdf2xml.h:175: error: ‘Stream’ has not been declared
pdf2xml.h:176: error: ‘GfxImageColorMap’ has not been declared
pdf2xml.h:177: error: ‘GBool’ has not been declared
pdf2xml.h:182: error: ‘GfxState’ has not been declared
pdf2xml.h:188: error: ‘GfxState’ has not been declared
pdf2xml.h:191: error: ‘GfxState’ has not been declared
pdf2xml.h:191: error: ‘GString’ has not been declared
pdf2xml.h:194: error: ‘Link’ has not been declared
pdf2xml.h:194: error: ‘Catalog’ has not been declared
pdf2xml.h:220: error: ‘GString’ has not been declared
pdf2xml.h:223: error: ‘GString’ has not been declared
pdf2xml.h:226: error: ‘GString’ has not been declared
pdf2xml.h:232: error: ISO C++ forbids declaration of ‘GString’ with no type
pdf2xml.h:232: error: expected ‘;’ before ‘&’ token
pdf2xml.h:235: error: ‘GString’ has not been declared
pdf2xml.h:235: error: ‘GString’ has not been declared
pdf2xml.h:238: error: ‘GfxState’ has not been declared
pdf2xml.h:238: error: ‘Object’ has not been declared
pdf2xml.h:238: error: ‘Stream’ has not been declared
pdf2xml.h:240: error: ‘GfxImageColorMap’ has not been declared
pdf2xml.h:241: error: ‘GBool’ has not been declared
pdf2xml.h:244: error: ‘GString’ has not been declared
pdf2xml.h:248: error: ‘png_color’ has not been declared
pdf2xml.h:252: error: ISO C++ forbids declaration of ‘GfxState’ with no type
pdf2xml.h:252: error: expected ‘;’ before ‘*’ token
pdf2xml.h:255: error: ‘GString’ does not name a type
pdf2xml.h:268: error: ‘GString’ does not name a type
pdf2xml.h:273: error: ‘GList’ does not name a type
pdf2xml.h:274: error: ISO C++ forbids declaration of ‘GString’ with no type
pdf2xml.h:274: error: expected ‘;’ before ‘&’ token
pdf2xml.h:278: error: ‘GString’ does not name a type
pdf2xml.h:247: error: ‘PNG_COLOR_TYPE_RGB’ was not declared in this scope
pdf2xml.h:248: error: ‘NULL’ was not declared in this scope
pdf2xml.cpp: In constructor ‘XmlOutput::XmlOutput()’:
pdf2xml.cpp:114: error: class ‘XmlOutput’ does not have any field named ‘xml_file’
pdf2xml.cpp: At global scope:
pdf2xml.cpp:122: error: ‘bool XmlOutput::open’ is not a static member of ‘class XmlOutput’
pdf2xml.cpp:122: error: ‘GString’ was not declared in this scope
pdf2xml.cpp:122: error: ‘filename’ was not declared in this scope
pdf2xml.cpp:123: error: expected ‘,’ or ‘;’ before ‘{’ token
pdf2xml.cpp: In member function ‘bool XmlOutput::write(const char*)’:
pdf2xml.cpp:135: error: ‘strlen’ was not declared in this scope
pdf2xml.cpp:136: error: ‘xml_file’ was not declared in this scope
pdf2xml.cpp: In member function ‘bool XmlOutput::close()’:
pdf2xml.cpp:182: error: ‘xml_file’ was not declared in this scope
pdf2xml.cpp: At global scope:
pdf2xml.cpp:193: error: ‘GString’ has not been declared
pdf2xml.cpp: In member function ‘bool XmlOutput::add_metatag(const char*, int*)’:
pdf2xml.cpp:207: error: request for member ‘getCString’ in ‘* value’, which is of non-class type ‘int’
pdf2xml.cpp:209: error: request for member ‘getLength’ in ‘* value’, which is of non-class type ‘int’
pdf2xml.cpp:211: error: request for member ‘getLength’ in ‘* value’, which is of non-class type ‘int’
pdf2xml.cpp:222: error: request for member ‘getLength’ in ‘* value’, which is of non-class type ‘int’
pdf2xml.cpp:246: error: request for member ‘getLength’ in ‘* value’, which is of non-class type ‘int’
pdf2xml.cpp:249: error: ‘Unicode’ was not declared in this scope
pdf2xml.cpp:249: error: expected ‘;’ before ‘u’
pdf2xml.cpp:257: error: ‘u’ was not declared in this scope
pdf2xml.cpp:257: error: expected primary-expression before ‘unsigned’
pdf2xml.cpp:257: error: expected ‘)’ before ‘char_value’
pdf2xml.cpp:261: error: ‘u’ was not declared in this scope
pdf2xml.cpp:261: error: expected primary-expression before ‘unsigned’
pdf2xml.cpp:261: error: expected ‘)’ before ‘char_value’
pdf2xml.cpp:261: error: expected ‘)’ before ‘;’ token
pdf2xml.cpp:266: error: ‘u’ was not declared in this scope
pdf2xml.cpp:266: error: expected ‘;’ before ‘char_value’
pdf2xml.cpp:269: error: ‘u’ was not declared in this scope
pdf2xml.cpp:296: error: ‘mapUTF8’ was not declared in this scope
pdf2xml.cpp: At global scope:
pdf2xml.cpp:346: error: ‘bool XmlOutput::change_font’ is not a static member of ‘class XmlOutput’
pdf2xml.cpp:346: error: ‘GString’ was not declared in this scope
pdf2xml.cpp:346: error: ‘face’ was not declared in this scope
pdf2xml.cpp:346: error: expected primary-expression before ‘int’
pdf2xml.cpp:346: error: expected primary-expression before ‘int’
pdf2xml.cpp:346: error: expected primary-expression before ‘bool’
pdf2xml.cpp:346: error: expected primary-expression before ‘bool’
pdf2xml.cpp:346: error: initializer expression list treated as compound expression
pdf2xml.cpp:347: error: expected ‘,’ or ‘;’ before ‘{’ token
(Ten post był ostatnio modyfikowany: 07.07.2010 19:14:25 przez dulaman.)
07.07.2010 19:11:57
Odwiedź stronę użytkownika Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
Ziemeck Offline
Pan na M

Liczba postów: 241
Dołączył: 30-06-2009
Reputacja: 5
Post: #7
RE: jak skompilować pdf2xml?
Nie jestem pewien, ale oo writer chyba ma taką funkcję.

The quieter you become, the more you are able to hear...

[Obrazek: sygnatura.jpg]
07.07.2010 20:19:33
Odwiedź stronę użytkownika Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
dulaman Offline
antyfan mikroszitu

Liczba postów: 92
Dołączył: 21-12-2009
Reputacja: 0
Post: #8
RE: jak skompilować pdf2xml?
OO Writer nie ma takiej funkcji, kiedy próbuje otworzyć nim plik *.pdf otwiera się OO Draw z tym właśnie plikiem gotowym do edycji.
07.07.2010 21:42:34
Odwiedź stronę użytkownika Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
Piotrek23 Offline
Moderator Globalny
******

Liczba postów: 479
Dołączył: 13-12-2008
Reputacja: 7
Post: #9
RE: jak skompilować pdf2xml?
Wytłumaczę Ci to jak dziecku, choć dzieckiem chyba nie jesteś. Każdy program C/C++/C(*) używa nagłówków, to te pliki z końcówką ".h", od "header" (przetłumacz sobie...). Google podaje:
Kod:
GList.h - glib-2.0(-dev)
PDFDoc.h - poppler(-dev)
OutputDev.h - poppler(-dev)
png.h - libpng(-dev)
Wszystko odnalazłem w przeciągu 30 sek. Zrozum to że nie masz zainstalowanych pakietów -dev i przy kompilacji nic nie zdziałasz.

[Obrazek: z1b9b.png]
(Ten post był ostatnio modyfikowany: 07.07.2010 22:12:49 przez Piotrek23.)
07.07.2010 22:12:20
Odwiedź stronę użytkownika Znajdź wszystkie posty użytkownika Odpowiedz cytując ten post
Odpowiedz 


Podobne wątki
Wątek: Autor Odpowiedzi: Wyświetleń: Ostatni post
  Jak zainstalować SilverLight ?? Poeta 14 6 252 17.10.2010 15:02:50
Ostatni post: eMcE
  [OpenSUSE 11.3]] Jak odpalić Defcon? Lachu 2 892 31.08.2010 11:30:52
Ostatni post: Lachu

Skocz do:


Użytkownicy przeglądający ten wątek: 1 gości

Kontakt | Linux360.pl - forum | Wróć do góry | Wróć do forów | Wersja bez grafiki | RSS