[PDF Import] LibreOffice extension for importing PDF documents -- pdfimport

Hi :slight_smile:
Errr, when posting a new question to the lists here please start a new email and use copy&paste to put the address into the "To" field.  Taking an existing thread and doing "Reply to" and just changing the subject-line doesn't create a new thread.  I have forwarded teh mail to the list to break it out of the old thread and createa  new one so it's ok now.  Sorry about this not working intuitively!  :frowning:

I have just been looking at the
http://musescore.org/en/handbook/file-format
website.  It looks as though saving as png or svg might get the results you want more effectively.  Not all systems can cope with svg (scalar vector graphics) yet but png seems to work everywhere and should be reasonably easy to print.

Good luck and regards from
Tom :slight_smile:

MAS and Tom,

Thank you for the prompt replies. Tom, My apologies for inappropriately creating a new thread by using "Reply" method which caused the
inconvenience as well as extra toil. And addition thanks for the effort and educating me.

The SVG and PNG are fine for me, but the PDF is a part of the requirements (which are out of my control) I am working on at present.

Best regards,

Pae

This is a testing purpose post since it appears to be I am getting two posts: one is partial that I do not think posted and the other
one is the one I posted. So, I am posting this to see what's going on.

Sorry for increasing traffic if this caused by my end.

Pae

Hi :slight_smile:
I have a feeling that it's worth posting a bug-report or 2 about this issue.  I would post one here.  This guide might help
http://wiki.documentfoundation.org/BugReport
but i think the problem might be with the way the pdfs are generated in MuseScore so i would post a bug-report with them too.
http://musescore.org/node/77

Both guides suggest posting a question in the relevant forum first.  If you could give us a link to the question you asked in their forum that might help.  Also they might find it useful to have a link to this thread in the question there.  I would copy the Nabble link to them
http://nabble.documentfoundation.org/Fw-Re-libreoffice-users-PDF-Import-LibreOffice-extension-for-importing-PDF-documents-pdfimport-td3503557.html

Likewise when you post a bug-report there and here it's good to give links so that people working in one project can easily have a look at what their counter-parts are doing in the other project.

Hmm, just a thought but once you have an svg or png you could open a new Draw document and drop the picture into it and then export that as Pdf.  When i do that i find the picture is not the same size as the A4 page so i use the "handles" at the corners of the picture to stretch it to fill (or almost fill) the page.  My printer always gives a 5mm blank area around the edges of pages so i don't always make the picture fully fit the page unless i want the edges trimmed off.

Don't worry about the ettiquette issue.  All forums and mailing lists have their own quirks and we often only find what they are by trial-and-error.  You are not the first and unlikely to be the last person that falls into that one.  Actually i think that particular quirk is shared by quite a lot of forums and mailing-lists so it's a good one to learn about early on.  Still a lot of people forget.  It wasn't a lot of extra work for me to fix.  I think 3 clicks and a drag instead of 1 [shrugs].  I've known worse! :wink:

Sorry such a long post!
Regards from
Tom :slight_smile:

This is not a PDFimport issue. When you import a PDF it will extract the
text and retain the font formatting (i.e. font name, size, effects, colour).
If the font is not installed on your PC it will be replaced by some other
font and the characters may look odd if the font is too different.

In the case of Musescore, the font is internal to the program and is
embedded in the PDF (which explains why the PDF looks good). If you look at
the document properties you will notice that MScore120 and MScore20 were
embedded. If you could get these exact fonts your PDFimport would look
better (I wont say perfect because that is highly unlikely :slight_smile: )

Bottom line: if the font is embedded in the PDF and you do not have the same
font installed on your PC, importing from PDF will produce a Draw document
with some font differences.

Pedro,

Thank you for reply. Whether the fonts are referenced or embedded, wouldn't it be more the renderer's responsibility
to display regardless the font is installed on the system level or not. It is reasonable to use the alternative font
if the renderer could not find the font from neither system level nor document.

For the testing purpose, with two different systems that do not have MuseScore related font, opening the PDF file
generated by MuseScore by Acrobat reader on Win/XP and Evince Document Viewer on Ubuntu seems fine. I am not certain
how PDF standard spec defined for the rendering part, but those renderer seems to be able to display fine without
the specific fonts on the system level.

Then, while assuming that the 'pdfimport' extension is doing its job, wouldn't it more LebreOffice(LO)'s responsibility,
e.g., LO/Draw, here?

Best reagrds,

Pae

Tom,

Once I understand better where the issue is coming from, it will be reasonable to ask them look at the code for the
possible bug. But I am not certain where the issue is coming from yet.

For manipulating the PNG and SVG to PDF, that was a nice tip, but it seems not quite meeting what I need. The initial
reason for this posting was to find out whether the LibreOffice with 'pdfimport' extension allows to edit the PDF file
or not. This rendering issue, however, is blocking the path.

I need to think about the alternatives. THANK YOU MUCH.

Best regards,

Pae

I'm guessing here, but the PDF document may contain only a subset of the relevant font. If you are opening a PDF document in a product such as LibreOffice (perhaps an unwise course at the best of times), you presumably intend to edit the contents. You may choose to insert characters which are not in the embedded subset. What is the editor then to do: mix individual characters from a substituted font with the original? Perhaps the chosen strategy to avoid the problem is to render the document in fonts that are going to be available to the editing process - that exist on the platform, that is.

Brian Barker

Pedro wrote:

In the case of Musescore, the font is internal to the program and is
embedded in the PDF (which explains why the PDF looks good).  If you look at
the document properties you will notice that MScore120 and MScore20 were
embedded. If you could get these exact fonts your PDFimport would look
better (I wont say perfect because that is highly unlikely :slight_smile: )

Bottom line: if the font is embedded in the PDF and you do not have the same
font installed on your PC, importing from PDF will produce a Draw document
with some font differences.

For this specific use-case, might it be possible to install the font?
I did a quick google search and it seems that the font is available
for download (MScore20 at least). But it was only a quick look, I
might be wrong.

Seeing as the font is embedded in the pdf file, maybe it's possible to
extract and then install it? Not sure how you would do that though.

Regards
Stephan

Hi :slight_smile:
I think once you have downloaded the font package all you need to do is double-click on the downloaded file and click "Ok".  I think it's about that easy even on Windows.  Tim at KrackedPress might have a better and more detailed method.  This would mean sending people 2 small files instead of just one.

Given that Windows currently has a big problem with embedded fonts it might be seen as good practice to do that anyway.  Apparently there are exploits out in the wild that can compromise a system through using a carefully crafted font that gets embedded in documents and then subverts the font reader.  By sending the font separately the antivirus programs have more chance of catching the nefarious font packages.  At the moment patches seem aimed at disabling programs ability to read embedded fonts but a better patch should appear soon.

So, even tho that is not the cause of the problem this time giving fonts as a separate package might be appreciated by people that have read the scare stories. 
Regards from
Tom :slight_smile:

Pae Choi wrote:

Whether the fonts are referenced or embedded,
wouldn't it be more the renderer's responsibility
to display regardless the font is installed on the system level or not.
It is reasonable to use the alternative font
if the renderer could not find the font from neither system level nor
document.

The answer is no. It is not the renderer's responsability. If the font is
not installed there is no way that another program can show it. There is no
legal way to use fonts from a document.

If the font is embedded in the document (like PDF and all MS documents) it
works WITHIN the document. By doing a PDFimport you are converting the
document so in all senses it is no longer the same document and therefore it
looses the right to use the fonts.

The fonts have included "instructions" on what you can do with them: freely
distribute, distribute for read only formats (such as PDF) or don't
distribute at all. This is due to Copyrights from the author of the font.

In any case, most of the times fonts are embedded as a subset (e.g. if you
embed the word Attention in a given font, only characters A, t, e, n, i, o
are included) so even if you could extract it, it would only allow you to
write words with those characters :slight_smile:

Hope this was clear enough (English is not my native language)

Brain, Mas, Pedro, Stephan, and Tom,
(Please accept my apologies to ones who are not listed here in case I missed.)

THANK YOU all for not only taking time but sharing the thoughts and wisdom that helped me understand better what is
going on with issue I had.

It is planned to get the source code from the MuseScore svn to extract the fonts and install them at the system level
to see how LibreOffice/Draw will show it.

This has been a pleasant learning experience. And I certainly enjoyed as well as appreciated.

Best regards,

Pae