From 6ff21888f307509ba7c5eef2d8d891718fb22dfc Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 27 Nov 2009 15:35:57 +0000 Subject: [PATCH] From Wang Rui, "I just successfully built the pdf plugin on Windows XP and MSVC and fixed a small bug then: ReaderWriterPDF.cpp, line 133, change: std::string uri = std::string("file:") + foundFile; to: #if defined(WIN32) && !defined(__CYGWIN__) std::string uri = std::string("file:///") + foundFile; #else std::string uri = std::string("file:") + foundFile; #endif That's because glib accepts "file:///C:\\data\\file.pdf" as URIs on Windows, as well as "file:/home/data/file.pdf" on Unix, but "file:C:\\data\\file.pdf" is not recognized. Now I could read my Chinese translation of OSGQSG with osgpdf. :P" --- src/osgPlugins/pdf/ReaderWriterPDF.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osgPlugins/pdf/ReaderWriterPDF.cpp b/src/osgPlugins/pdf/ReaderWriterPDF.cpp index 50e474bc9..2887f668e 100644 --- a/src/osgPlugins/pdf/ReaderWriterPDF.cpp +++ b/src/osgPlugins/pdf/ReaderWriterPDF.cpp @@ -130,7 +130,11 @@ class PopplerPdfImage : public osgWidget::PdfImage gTypeInit = true; } +#if defined(WIN32) && !defined(__CYGWIN__) + std::string uri = std::string("file:///") + foundFile; +#else std::string uri = std::string("file:") + foundFile; +#endif PopplerDocument* doc = poppler_document_new_from_file(uri.c_str(), NULL, NULL); if (!doc)