|
From: Daniel J S. <dan...@ie...> - 2005-01-07 20:39:40
|
I'm seeing the following error message when viewing Gnuplot generated PDF files: This file may contain newer information than this viewer can support. It may not open or display correctly. Adobe recommends that you upgrade to the latest version of our Acrobat products. Please visit our product site at http://www.adobe.com/acrobat The version is AcroRead 5.10. I can't say when this started happening. I just recently upgraded my system, along with the version of acroread. However, I found this out through a collegue who may be running a slightly older version of AcroRead, say 5.6. In any case, the contents of the file seem viewable. Perhaps something wrong with the PDF library? (Ethan?) I think I just compiled the most recent version of PDFlib-Lite. (PDFlib-6.0.1p1-Linux.tar.gz) Either 1) PDF library does something acroread doesn't like. 2) PDF library isn't being called correctly to build a header 3) Acroread added an error message from 5.6 to 5.10 and complains where it used to not know the difference... and Acroread 7.0 can actually handle what is in PDF library, it's just that there's only a beta version of Acroread 7.0 just yet. Dan |
|
From: Ethan M. <merritt@u.washington.edu> - 2005-01-07 20:49:50
|
On Friday 07 January 2005 12:41 pm, Daniel J Sebald wrote: > > In any case, the contents of the file seem viewable. Perhaps something > wrong with the PDF library? (Ethan?) I think I just compiled the most > recent version of PDFlib-Lite. (PDFlib-6.0.1p1-Linux.tar.gz) Either > > 1) PDF library does something acroread doesn't like. The first line of the output from PDFlib is now %PDF-1.5 It used to be %PDF-1.2 Whether PDFlib actually *uses* any of the features introduced since 1.2, that I don't know. > 3) Acroread added an error message from 5.6 to 5.10 and complains where > it used to not know the difference... and Acroread 7.0 can actually > handle what is in PDF library, it's just that there's only a beta > version of Acroread 7.0 just yet. The world has moved on, and Acroread for linux mostly hasn't. Version 5.8 now spits out this warning message for a majority of PDF files that I have to deal with each day from many sources. Nevertheless, even files that truly do contains elements not fully supported by 5.8 (e.g. fillable forms) still display and edit properly. So it's annoying, but harmless. -- Ethan A Merritt merritt@u.washington.edu Biomolecular Structure Center Mailstop 357742 University of Washington, Seattle, WA 98195 |
|
From: Harald H. <h.h...@tu...> - 2005-01-07 23:27:24
|
On Fri, 7 Jan 2005, Ethan Merritt wrote: > On Friday 07 January 2005 12:41 pm, Daniel J Sebald wrote: > > > > In any case, the contents of the file seem viewable. Perhaps something > > wrong with the PDF library? (Ethan?) I think I just compiled the most > > recent version of PDFlib-Lite. (PDFlib-6.0.1p1-Linux.tar.gz) Either > > > > 1) PDF library does something acroread doesn't like. > > The first line of the output from PDFlib is now > %PDF-1.5 > It used to be > %PDF-1.2 > > Whether PDFlib actually *uses* any of the features introduced since > 1.2, that I don't know. I am rather sure that it does not use any features newer than PDF-1.4. My Patch #1023783, Write username to pdf and ps plots and fix both terminals, solves this problem. It uses the current PDFlib syntax if available and sets PDF to compatibility level 1.4. And it solves some more problems. For example, original gnuplot states in every plot that the author of this plot was Hans-Bernhard Broeker, in the official version. This of course is not the correct way to handle it. The patch tries to find out the name of the current user and uses this one. Some effort is done to work with Unix and Windows. The Windows part has to be tested since I do not have Windows. In addition, this patch adds information to postscript files that enable ghostscript (and hopefully Acrobat) to set the username and title of the plot correctly when converting the postscript file to pdf. Please have a look at this patch. I really think it is useful. I am using it since I have uploaded it to sf.net and I never had any problems. Harald -- Harald Harders h.h...@tu... http://www.harald-harders.de |
|
From: Daniel J S. <dan...@ie...> - 2005-01-08 05:22:34
|
Harald Harders wrote: >On Fri, 7 Jan 2005, Ethan Merritt wrote: > > > >>On Friday 07 January 2005 12:41 pm, Daniel J Sebald wrote: >> >> >>>In any case, the contents of the file seem viewable. Perhaps something >>>wrong with the PDF library? (Ethan?) I think I just compiled the most >>>recent version of PDFlib-Lite. (PDFlib-6.0.1p1-Linux.tar.gz) Either >>> >>>1) PDF library does something acroread doesn't like. >>> >>> >>The first line of the output from PDFlib is now >> %PDF-1.5 >>It used to be >> %PDF-1.2 >> >>Whether PDFlib actually *uses* any of the features introduced since >>1.2, that I don't know. >> >> > >I am rather sure that it does not use any features newer than PDF-1.4. My >Patch #1023783, Write username to pdf and ps plots and fix both terminals, >solves this problem. It uses the current PDFlib syntax if available and >sets PDF to compatibility level 1.4. And it solves some more problems. For >example, original gnuplot states in every plot that the author of this >plot was Hans-Bernhard Broeker, in the official version. This of course >is not the correct way to handle it. The patch tries to find out the name >of the current user and uses this one. Some effort is done to work with >Unix and Windows. The Windows part has to be tested since I do not have >Windows. > >In addition, this patch adds information to postscript files that enable >ghostscript (and hopefully Acrobat) to set the username and title of the >plot correctly when converting the postscript file to pdf. > >Please have a look at this patch. I really think it is useful. I am using >it since I have uploaded it to sf.net and I never had any problems. > >Harald > > These all look like nice improvements. The error message is gone. Details, including user's name show up in the file. Why not move the patch into CVS while on the topic? One thing I wonder is if we could include some way to provide an alternate user name or notice. For example, say I don't want my account user name in the file, but rather a company name, work group name, or maybe copyright notice. Does this seem like something worthwhile? Maybe something like another environment variable GNUPLOT_USERNAME. Or were we trying to move away from too many environment variables for gnuplot? Dan PS: Looking through the code I see a couple things. First "gnuplot diagram" is ok, but its technically not a diagram I guess. (But you probably thought "gnuplot plot" just doesn't read well.) Second, the following lines of malloc/free are generally OK. But the one case where username2 is zero and username isn't might be a problem. (But the only case that would happen is if the system runs out of memory right after allocating username.) + char *username=getusername(); + char *username2=pspdf_escape_string(username,"()\\"); <snip> + if (username2) { + free(username); + free(username2); + } |
|
From: Ethan M. <merritt@u.washington.edu> - 2005-01-08 05:44:40
|
On Friday 07 January 2005 09:24 pm, Daniel J Sebald wrote: > Second, the > following lines of malloc/free are generally OK. But the one case where > username2 is zero and username isn't might be a problem. free(NULL) is perfectly legal. The test if (foo) free(foo); is common, but not necessary. -- Ethan A Merritt Biomolecular Structure Center University of Washington 98195-7742 |
|
From: Harald H. <h.h...@tu...> - 2005-01-08 11:25:55
|
On Fri, 7 Jan 2005, Daniel J Sebald wrote: > Harald Harders wrote: > > >On Fri, 7 Jan 2005, Ethan Merritt wrote: > > > >Please have a look at this patch. I really think it is useful. I am using > >it since I have uploaded it to sf.net and I never had any problems. > > > These all look like nice improvements. The error message is gone. > Details, including user's name show up in the file. Why not move the > patch into CVS while on the topic? One thing I wonder is if we could > include some way to provide an alternate user name or notice. For > example, say I don't want my account user name in the file, but rather a > company name, work group name, or maybe copyright notice. Does this > seem like something worthwhile? Maybe something like another > environment variable GNUPLOT_USERNAME. Or were we trying to move away > from too many environment variables for gnuplot? With unix, this patch already uses the environment variables USER or USERNAME. You can force a username by setting one of these, e.g., using a bash: USER='I myself' gnuplot I have changed it locally that also Windows looks at these environment variables. I have also thought if I would be worth to introduce something like set fileinfo username 'Harald' title 'Main plot' subject 'test' Here, also things as keywords could be set. These information could also be used by other terminals that produce output files which support information (e.g., jpeg). The fileinfo command could default to the values used at the moment. > PS: Looking through the code I see a couple things. First "gnuplot > diagram" is ok, but its technically not a diagram I guess. (But you > probably thought "gnuplot plot" just doesn't read well.) I have changed it to "gnuplot plot". If somebody has a better idea, please send it to the mailing list. > Second, the > following lines of malloc/free are generally OK. But the one case where > username2 is zero and username isn't might be a problem. (But the only > case that would happen is if the system runs out of memory right after > allocating username.) I will change it. Greetings Harald -- Harald Harders h.h...@tu... http://www.harald-harders.de |
|
From: Harald H. <h.h...@tu...> - 2005-01-09 15:37:35
|
I have updated the username patch now to work with the current cvs version. Since I don't have Windows available, does somebody compile gnuplot with Windows and can test the patch there? Gnuplot should either use the Windows login name or one of the environment variables USER or USERNAME to set the Author for the pdf and postscript terminal. When using the postscript terminal, information should be written into the postscript file that is interpreted by ghostscript and Acrobat. With ghostscript, it works. Can please somebody test if Acrobat also takes these information for the pdf file information? Another thing are information in other terminals. For example, the jpeg file format can take information, e.g., as exif strings (as digital cameras do it). Unfortunately, the gd library does not support these. I have spoken to the maintainer of this library. He would be glad if somebody of the gnuplot people programmes a patch for his package. I have had a look to it and don't know how it could be done. If somebody volunteers to do it ... Do other file formats also support comments? Thanks, Harald -- Harald Harders h.h...@tu... http://www.harald-harders.de |
|
From: Daniel J S. <dan...@ie...> - 2005-01-09 19:04:52
|
Harald Harders wrote: >I have updated the username patch now to work with the current cvs >version. Since I don't have Windows available, does somebody compile >gnuplot with Windows and can test the patch there? Gnuplot should either >use the Windows login name or one of the environment variables USER or >USERNAME to set the Author for the pdf and postscript terminal. > >When using the postscript terminal, information should be written into the >postscript file that is interpreted by ghostscript and Acrobat. With >ghostscript, it works. Can please somebody test if Acrobat also takes >these information for the pdf file information? > Do you mean in Windows? For Acrobat on linux I'm seeing file information in Acrobat for PDF directly and ps2pdf. (In one case I see the Creator is PDFlib Lite 6.0.1 (Linux); in the other case GNU Ghostscript 7.07.) The former PDF looks better because the border white space is smaller and more even. The issue with the latter is Ghostscript (probably some margins need to be set in a defaults file). The PostScript file created by Gnuplot does hav e a little bit of unbalanced white space borders when viewed in letter layout (bounding box layout looks fine). Someone can cross that bridge some other day. For some reason "ggv" and "xpdf" do not show file information. Why? I don't know. Dan |
|
From: Harald H. <h.h...@tu...> - 2005-01-09 19:35:49
|
On Sun, 9 Jan 2005, Daniel J Sebald wrote: > Harald Harders wrote: > >I have updated the username patch now to work with the current cvs > >version. Since I don't have Windows available, does somebody compile > >gnuplot with Windows and can test the patch there? Gnuplot should either > >use the Windows login name or one of the environment variables USER or > >USERNAME to set the Author for the pdf and postscript terminal. > > > >When using the postscript terminal, information should be written into the > >postscript file that is interpreted by ghostscript and Acrobat. With > >ghostscript, it works. Can please somebody test if Acrobat also takes > >these information for the pdf file information? > > Do you mean in Windows? I ment both, since I do not have Acrobat at all. > For Acrobat on linux I'm seeing file > information in Acrobat for PDF directly and ps2pdf. (In one case I see > the Creator is PDFlib Lite 6.0.1 (Linux); in the other case GNU > Ghostscript 7.07.) So, you see in "General Info" in Acroread: File: <filename> Title: <filename> Subject: gnuplot plot Author: Daniel J Sebald Keywords: Binding: Left Edge Creator: gnuplot 4.1 patchlevel 0 Producer: PDFlib Lite 6.0.1 resp. Ghostscript 7.07 Created: <date> ... PDF Version: 1.4 resp. 1.3 > The former PDF looks better because the border white > space is smaller and more even. The issue with the latter is > Ghostscript (probably some margins need to be set in a defaults file). You are using a really old ghostscript version. The current is 8.50. Many improvements concerning pdf production have been made in the meantime. > The PostScript file created by Gnuplot does hav e a little bit of > unbalanced white space borders when viewed in letter layout (bounding > box layout looks fine). Are you describing, where the plot is inside the BoundingBox? That should be another problem that does not have to do with this patch. > Someone can cross that bridge some other day. > For some reason "ggv" and "xpdf" do not show file information. Why? I > don't know. Thus, you have a pdf file with information, shown by Acroread? But if viewed in xpdf, they are not shown? Strange. Harald -- Harald Harders h.h...@tu... http://www.harald-harders.de |
|
From: Daniel J S. <dan...@ie...> - 2005-01-09 19:46:05
|
Harald Harders wrote: > I ment both, since I do not have Acrobat at all. You can download 5.10 from Adobe's site. >So, you see in "General Info" in Acroread: > >File: <filename> >Title: <filename> >Subject: gnuplot plot >Author: Daniel J Sebald >Keywords: >Binding: Left Edge >Creator: gnuplot 4.1 patchlevel 0 >Producer: PDFlib Lite 6.0.1 resp. Ghostscript 7.07 >Created: <date> >... >PDF Version: 1.4 resp. 1.3 > > Yes. >>For some reason "ggv" and "xpdf" do not show file information. Why? I >>don't know. >> >> > Someone can cross that bridge some other day. > > >Thus, you have a pdf file with information, shown by Acroread? But if >viewed in xpdf, they are not shown? Strange. > You're OK. I mean xpdf provides no means of displaying file info, not that I can see. Dan |
|
From: Daniel J S. <dan...@ie...> - 2005-01-09 21:28:13
|
Harald Harders wrote: >>> #713166 margins changed from int to float >>> >> > set terminal postscript eps 'Times-Roman' 22 > set output 'margins-1.eps' > set bmargin 1 > plot sin(x) > set output > set output 'margins-2.eps' > set bmargin 2 > plot sin(x) > set output > > You either crop the xtics or you have white space below them. > > I think that was pretty much the reason for the patch. When importing a figure, it's easier to add white space than to remove it. Removing it, in LaTeX at least, is slightly trial and error, but also I think it will end up causing warning messages because the figure might be slightly too big even, though it may be white space hanging over the edge of a margin. > This is one of my major problems I have using Gnuplot. My current > workaround is to use multiplot: > > ... > set multiplot > set size ... > set origin ... > set lmargin 0 > set bmargin 0 > set tmargin 0 > set rmargin 0 > plot ... > unset multiplot > > By variing the inner size and origin, I adjust the margins. But this is a > bad hack. > > I recall a bit of discussion about this alternative. I too am not real happy with the solution because, again, there is too much trial and error. It always feels like a major undertaking to layout the plots. It's nice to be able to fall back on precise positioning, but it's also nice to be able to slightly tweak something that is almost what one wants. Even "set bmargin #" is trial and error, but not too bad. I'd be open to a nicer, more obvious syntax. Maybe bmargin could be the amount of white space and then the xlabel would start right where the whitespace ends. Could make for tricky programming across terminals, however. Dan |
|
From: Juergen W. <wie...@fr...> - 2005-01-10 20:22:20
|
On Sunday 09 January 2005 20:06, Daniel J Sebald wrote: > For some reason "ggv" and "xpdf" do not show file information. Why? I > don't know. Xpdf is distributed with the command line tool pdfinfo. Juergen |
|
From: Daniel J S. <dan...@ie...> - 2005-01-10 22:02:05
|
Juergen Wieferink wrote: >On Sunday 09 January 2005 20:06, Daniel J Sebald wrote: > > >>For some reason "ggv" and "xpdf" do not show file information. Why? I >>don't know. >> >> > >Xpdf is distributed with the command line tool pdfinfo. > > Well, I'll be. The displayed info through pdfinfo is the same as shown in Acroread. So, the patch seems to work correctly as far as I can tell. Dan |