Re: [Inkscape-devel] pdf_input.inx
On 9/23/05, Eric Wilhelm <scratchcomputing@...400...> wrote:
# from Alexandre Prokoudine # on Friday 23 September 2005 11:29 am:
Inkscape tells me:
Can't locate Math/Matrix.pm in @INC
You're just missing a perl module "Math::Matrix". Grab it from CPAN or with your distro's installer.
Well, this is the revenge for not reading README :) On the other hand, pdf2svg requires much more Perl modules that it is stated. I'm still grabbing all of them from CPAN.
Compilation failed in require at /usr/local/share/inkscape/extensions/pdf2svg line 20.
Does pdf2svg have an installer? (e.g. Module::Build, Makefile.PL, etc.)
No, no installer
Alexandre
On 9/23/05, Alexandre Prokoudine <alexandre.prokoudine@...400...> wrote:
Can't locate Math/Matrix.pm in @INC
You're just missing a perl module "Math::Matrix". Grab it from CPAN or with your distro's installer.
Well, this is the revenge for not reading README :) On the other hand, pdf2svg requires much more Perl modules that it is stated. I'm still grabbing all of them from CPAN.
After installing 10 extra modules I see;
Can't call method "infilt" on an undefined value at /usr/share/perl/5.8/pdfStream.pm line 111.
Alexandre
On Fri, Sep 23, 2005 at 11:03:26PM +0400, Alexandre Prokoudine wrote:
On 9/23/05, Eric Wilhelm <scratchcomputing@...400...> wrote:
Compilation failed in require at /usr/local/share/inkscape/extensions/pdf2svg line 20.
Does pdf2svg have an installer? (e.g. Module::Build, Makefile.PL, etc.)
No, no installer
Here is an installer for you. Save this to Makefile.PL:
----------- use ExtUtils::MakeMaker;
my %opts = ( 'NAME' => 'pdf2svg', 'VERSION' => "1.00", 'EXE_FILES' => [ qw( scripts/pdf2svg ) ], 'PREREQ_PM' => { 'Math::Matrix' => 0, 'Getopt::Long' => 0, }, );
if ($ExtUtils::MakeMaker::VERSION >= 5.43) { $opts{AUTHOR} = 'Author S. Name <here@...997...>'; $opts{ABSTRACT} = 'Converts PDF files into SVG'; }
WriteMakefile( %opts ) -------------
Replace "1.00" with whatever the real version is, and set the author name to yourself or whomever wrote pdf2svg. Also, add all the perl modules you needed to install to that PREREQ_PM section.
Then, to check you did it right, do this:
$ perl -c Makefile.PL
When that says 'ok', then do this to test it:
$ perl Makefile.PL $ make
Bryce
On 9/23/05, Bryce Harrington <bryce@...961...> wrote:
When that says 'ok', then do this to test it:
$ perl Makefile.PL
avp@...998...:~/soft/build/graphics/pdf2svg$ perl Makefile.PL Warning: prerequisite Text::PDF::API2 0 not found. Writing Makefile for pdf2svg avp@...998...:~/soft/build/graphics/pdf2svg$ make cp FontInfo.pm blib/lib/FontInfo.pm cp Scanner.pm blib/lib/Scanner.pm cp Parser.pm blib/lib/Parser.pm cp pdfGraphics.pm blib/lib/pdfGraphics.pm cp Gfxstate.pm blib/lib/Gfxstate.pm cp Subpath.pm blib/lib/Subpath.pm cp pdfStream.pm blib/lib/pdfStream.pm make: *** No rule tocompile target `scripts/pdf2svg', required for `blib/script/pdf2svg'. Stop.
In the meantime:
=head1 HISTORY
$Log: API2.pm,v $ Revision 1.83 2005/09/12 16:54:21 fredo added -isocmap option
Alexandre
On Sat, Sep 24, 2005 at 12:20:50AM +0400, Alexandre Prokoudine wrote:
On 9/23/05, Bryce Harrington <bryce@...961...> wrote:
When that says 'ok', then do this to test it:
$ perl Makefile.PL
avp@...998...:~/soft/build/graphics/pdf2svg$ perl Makefile.PL Warning: prerequisite Text::PDF::API2 0 not found.
Did you mean 'Text::PDF'? I wasn't able to find a Text::PDF::API2 library on cpan...
Writing Makefile for pdf2svg avp@...998...:~/soft/build/graphics/pdf2svg$ make cp FontInfo.pm blib/lib/FontInfo.pm cp Scanner.pm blib/lib/Scanner.pm cp Parser.pm blib/lib/Parser.pm cp pdfGraphics.pm blib/lib/pdfGraphics.pm cp Gfxstate.pm blib/lib/Gfxstate.pm cp Subpath.pm blib/lib/Subpath.pm cp pdfStream.pm blib/lib/pdfStream.pm make: *** No rule tocompile target `scripts/pdf2svg', required for `blib/script/pdf2svg'. Stop.
In the Makefile.PL, change 'scripts/pdf2svg' to 'pdf2svg' or whereever you put the pdf2svg script in the package.
Bryce
On 9/24/05, Bryce Harrington <bryce@...961...> wrote:
On Sat, Sep 24, 2005 at 12:20:50AM +0400, Alexandre Prokoudine wrote:
On 9/23/05, Bryce Harrington <bryce@...961...> wrote:
When that says 'ok', then do this to test it:
$ perl Makefile.PL
avp@...998...:~/soft/build/graphics/pdf2svg$ perl Makefile.PL Warning: prerequisite Text::PDF::API2 0 not found.
Did you mean 'Text::PDF'? I wasn't able to find a Text::PDF::API2 library on cpan...
Silly me.It was supposed to be PDF::API2.
http://search.cpan.org/author/AREIBENS/PDF-API2-0.46/lib/PDF/API2.pm
However...
avp@...998...:~/soft/build/graphics/pdf2svg$ perl Makefile.PL Warning: prerequisite PDF::API2 0 not found. Writing Makefile for pdf2svg
In the Makefile.PL, change 'scripts/pdf2svg' to 'pdf2svg' or whereever you put the pdf2svg script in the package.
Fixed. The output is above.
P.S. I'm sorry with wasting your time to teach me basics.
Alexandre
On Sat, Sep 24, 2005 at 12:38:27AM +0400, Alexandre Prokoudine wrote:
On 9/24/05, Bryce Harrington <bryce@...961...> wrote:
On Sat, Sep 24, 2005 at 12:20:50AM +0400, Alexandre Prokoudine wrote:
On 9/23/05, Bryce Harrington <bryce@...961...> wrote:
When that says 'ok', then do this to test it:
$ perl Makefile.PL
avp@...998...:~/soft/build/graphics/pdf2svg$ perl Makefile.PL Warning: prerequisite Text::PDF::API2 0 not found.
Did you mean 'Text::PDF'? I wasn't able to find a Text::PDF::API2 library on cpan...
Silly me.It was supposed to be PDF::API2.
http://search.cpan.org/author/AREIBENS/PDF-API2-0.46/lib/PDF/API2.pm
However...
avp@...998...:~/soft/build/graphics/pdf2svg$ perl Makefile.PL Warning: prerequisite PDF::API2 0 not found.
This should not give you a warning if you have this module installed correctly. Try doing this:
$ perl -e "use PDF::API2"
If you have the module installed, this should return with no output. Otherwise, it will spew a big error message showing all the paths that it looked at for the module.
I'd doublecheck that you do have the module installed, as that's almost always the issue.
In the Makefile.PL, change 'scripts/pdf2svg' to 'pdf2svg' or whereever you put the pdf2svg script in the package.
Fixed. The output is above.
P.S. I'm sorry with wasting your time to teach me basics.
No prob, thanks for investigating this in the first place! Saves the rest of us some trouble. :-)
Bryce
On 9/24/05, Bryce Harrington <bryce@...961...> wrote:
avp@...998...:~/soft/build/graphics/pdf2svg$ perl Makefile.PL Warning: prerequisite PDF::API2 0 not found.
This should not give you a warning if you have this module installed correctly. Try doing this:
$ perl -e "use PDF::API2"
If you have the module installed, this should return with no output. Otherwise, it will spew a big error message showing all the paths that it looked at for the module.
avp@...998...:~/soft/build/graphics/pdf2svg$ perl -e "use PDF::API2" Can't locate PDF/API2/Basic/PDF/File.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /usr/share/perl/5.8/PDF/API2.pm line 49. BEGIN failed--compilation aborted at /usr/share/perl/5.8/PDF/API2.pm line 49. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1.
Hmmmm... The line is:
use PDF::API2::Basic::PDF::File;
Okay, I created new directory /usr/share/perl/5.8/PDF/API2/Basic/PDF/ and copied File.pm, Page.pm and Utils.pm there.
Now the error is in line 53:
use PDF::API2::Util;
I can't find any Text::PDF::Util module at CPAN
Alexandre
On Sat, Sep 24, 2005 at 01:27:39AM +0400, Alexandre Prokoudine wrote:
On 9/24/05, Bryce Harrington <bryce@...961...> wrote:
avp@...998...:~/soft/build/graphics/pdf2svg$ perl Makefile.PL Warning: prerequisite PDF::API2 0 not found.
This should not give you a warning if you have this module installed correctly. Try doing this:
$ perl -e "use PDF::API2"
If you have the module installed, this should return with no output. Otherwise, it will spew a big error message showing all the paths that it looked at for the module.
avp@...998...:~/soft/build/graphics/pdf2svg$ perl -e "use PDF::API2" Can't locate PDF/API2/Basic/PDF/File.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /usr/share/perl/5.8/PDF/API2.pm line 49. BEGIN failed--compilation aborted at /usr/share/perl/5.8/PDF/API2.pm line 49. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1.
Hmmmm... The line is:
use PDF::API2::Basic::PDF::File;
Okay, I created new directory /usr/share/perl/5.8/PDF/API2/Basic/PDF/ and copied File.pm, Page.pm and Utils.pm there.
Hmm, normally you should not need to do this. Sounds like either something is not installed right, or there is a bug in PDF::API2.
Now the error is in line 53:
use PDF::API2::Util;
I can't find any Text::PDF::Util module at CPAN
There is a Text::PDF::Utils in this package:
http://search.cpan.org/~mhosken/Text-PDF-0.25/
Try that
Bryce
On 9/24/05, Bryce Harrington <bryce@...961...> wrote:
I can't find any Text::PDF::Util module at CPAN
There is a Text::PDF::Utils in this package:
I have it in /usr/share/perl/5.8/Text/PDF/, but Perl complains about Text::PDF::Util, not Text::PDF::Utils.
Alexandre
On Sat, Sep 24, 2005 at 05:58:23AM +0400, Alexandre Prokoudine wrote:
On 9/24/05, Bryce Harrington <bryce@...961...> wrote:
I can't find any Text::PDF::Util module at CPAN
There is a Text::PDF::Utils in this package:
I have it in /usr/share/perl/5.8/Text/PDF/, but Perl complains about Text::PDF::Util, not Text::PDF::Utils.
Sounds like a typo in the script perhaps...? Grep for Utils and correct it to Util and see if that fixes it.
Bryce
On 9/24/05, Bryce Harrington <bryce@...961...> wrote:
On Sat, Sep 24, 2005 at 05:58:23AM +0400, Alexandre Prokoudine wrote:
On 9/24/05, Bryce Harrington <bryce@...961...> wrote:
I can't find any Text::PDF::Util module at CPAN
There is a Text::PDF::Utils in this package:
I have it in /usr/share/perl/5.8/Text/PDF/, but Perl complains about Text::PDF::Util, not Text::PDF::Utils.
Sounds like a typo in the script perhaps...? Grep for Utils and correct it to Util and see if that fixes it.
Still no fun
avp@...998...:~/soft/build/graphics/pdf2svg$ perl -e "use PDF::API2" Can't locate PDF/API2/Basic/PDF/Util.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /usr/share/perl/5.8/PDF/API2.pm line 51. BEGIN failed--compilation aborted at /usr/share/perl/5.8/PDF/API2.pm line 51. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1.
Alexandre
On Sun, Sep 25, 2005 at 06:44:06AM +0400, Alexandre Prokoudine wrote:
On 9/24/05, Bryce Harrington <bryce@...961...> wrote:
On Sat, Sep 24, 2005 at 05:58:23AM +0400, Alexandre Prokoudine wrote:
On 9/24/05, Bryce Harrington <bryce@...961...> wrote:
I can't find any Text::PDF::Util module at CPAN
There is a Text::PDF::Utils in this package:
I have it in /usr/share/perl/5.8/Text/PDF/, but Perl complains about Text::PDF::Util, not Text::PDF::Utils.
Sounds like a typo in the script perhaps...? Grep for Utils and correct it to Util and see if that fixes it.
Still no fun
avp@...998...:~/soft/build/graphics/pdf2svg$ perl -e "use PDF::API2" Can't locate PDF/API2/Basic/PDF/Util.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /usr/share/perl/5.8/PDF/API2.pm line 51. BEGIN failed--compilation aborted at /usr/share/perl/5.8/PDF/API2.pm line 51. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1.
Email me the Makefile.PL, I'll take a look at it and try to fix it.
Bryce
On Sun, Sep 25, 2005 at 06:44:06AM +0400, Alexandre Prokoudine wrote:
On 9/24/05, Bryce Harrington <bryce@...961...> wrote:
On Sat, Sep 24, 2005 at 05:58:23AM +0400, Alexandre Prokoudine wrote:
On 9/24/05, Bryce Harrington <bryce@...961...> wrote:
I can't find any Text::PDF::Util module at CPAN
There is a Text::PDF::Utils in this package:
I have it in /usr/share/perl/5.8/Text/PDF/, but Perl complains about Text::PDF::Util, not Text::PDF::Utils.
Sounds like a typo in the script perhaps...? Grep for Utils and correct it to Util and see if that fixes it.
Still no fun
avp@...998...:~/soft/build/graphics/pdf2svg$ perl -e "use PDF::API2" Can't locate PDF/API2/Basic/PDF/Util.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at /usr/share/perl/5.8/PDF/API2.pm line 51. BEGIN failed--compilation aborted at /usr/share/perl/5.8/PDF/API2.pm line 51. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1.
This is what I did to get it to run:
# cpan -i PDF::API2
Then from the pdf2svg directory I ran it on a PDF file:
$ ./pdf2svg myfile.pdf
It created SVG files. Sometimes it wrote them to disk, sometimes it printed to stdout and I redirected it to a file.
In all cases, though, the SVG files that pdf2svg could not be read in Inkscape. I got errors from inkscape such as the following:
/home/bryce/Build/pdf2svg/OSDL.svg:702: parser error : StartTag: invalid element name r:#000000; font-family: Thorndale, Times New Roman, serif; letter-spacing: 0;"><
Hrm............
Bryce
Hey Alexandre!
I found a procedure for getting pdfs into svg reasonably well. It doesn't always work but when it does work, it seems pretty good.
First you need a program called pdftops (there is another called pdf2ps but it doesn't work; you need pdftops). I think it may be included with the xpdf package (http://www.foolabs.com/xpdf/). Its manpage says it is from "Glyph & Cog, LLC".
Now you can run this on your pdf files to produce ps files. This appears to work -ok-.
Second, you need scribus. This is from www.scribus.net.
Launch scribus and go to File->Import, then Import EPS/PS, and then select the PS file you created with pdf2ps.
Now check that the file loaded in scribus correctly. In my tests, I tried it on four random pdf files I had, each from a different source. Three of them loaded OK, one did not.
Third, go to File->Export, then Export as SVG. Type in the filename.svg and save it.
Finally, load the SVG up in Inkscape. Of the three that Scribus accepted, all three loaded into Inkscape.
However, one caveat... I found that all the text was converted into curves, so the PDF I took that was a letter came through uneditable. I also did a brochure that came through really poorly; the text wasn't even anti-aliased.
But... it did work.
Give this process a try and let me know what you think.
Bryce
On 9/25/05, Bryce Harrington <bryce@...961...> wrote:
Give this process a try and let me know what you think.
Being Sribus' user and translator into Russian I'm pretty familiar with its import/export abilities ;)
My intent was to make Inkscape read PDFs itself via extension. Looks like you have done preliminary work in this area :)
Alexandre
participants (2)
-
Alexandre Prokoudine
-
Bryce Harrington