Hot answers tagged

22

The package and all code of this answer can be found on my GitHub account. A solution that takes only small amount of time is to follow this route: take the first usable java library for accessing and changing PDF files you find do one of the following: write a small amount of Java code to create a simple interface to the functionality (if you are ...


13

From the PDF file definitions (7.5.4 - 7.5.6) you don't need to modify the inner structure of a PDF file to make changes, its enough to append the new definitions of the components (New or old) and suitable cross-reference section with pointers to the shift positions of some relevant components for random access. Here I attempt some code to do all the work ...


12

Indeed, 3D plots like this were exported as vector graphics with generally huge numbers of polygons in version 8. But even then, the export was automatically rasterized whenever there were VertexColors present in the plot. I described this as a trick for getting smaller PDF files here, and also used it e.g. here. So in general, I think it's actually a good ...


11

This is actually a complex problem because different journals and papers have different names for the bibliography (e.g. "Bibliography" versus "References") and different referencing formats that are hard to parse. Also some papers put other material (e.g. appendices) after the bibliography rather than before. That said, here is something to get you ...


5

On OS X, a simple workaround is to re-save the Mathematica-exported PDF with Preview.app before placing it. Simply open it in Preview and press ⌘-S. I did try processing the PDF through several other programs, but Preview was the only one that worked with all files I tried without destroying them. Some others worked only with PDFs containing no ...


4

You need to set the page size as well as the paper size. I can only test this in V10.1 but it works: nb = CreateDocument[{TextCell["PDF Test", "Section"],Table[PieChart@Range@5, {7}]}]; SetOptions[nb, PrintingOptions -> {"PaperOrientation"->"Landscape","PageSize" -> {1296, 864}, "PaperSize" -> {1296, 864}}]; SetOptions[nb, ...


4

I suspect that the fuzziness you see might not be caused by rasterization, but rather by antialiasing applied to the ArrayPlot markers. Anti-aliasing makes the edges of small graphical elements fuzzy to avoid jaggedness, and it is typically a good thing that generates visually pleasing results. In your case, however, the very small plot markers present in a ...


4

Update 2015-05-14 I contacted WRI support and they confirmed that this is a known issue with Export (support case: 3206586). Summary @ChenStatsYu seems to have found an unexplained behavior of the Export function for PDF files that looks like a bug. Detailed results 1) I generated two graphics similar to those in the OP's original question, then ...


3

As there has not been any further input so far, I shall try to expand my latest edits into a complete answer. As mentioned before, Mathematica's apparent behavior is that ImageSize is given in units equal to 1/72 of an inch. The default resolution when outputting to a raster format is also 72dpi. So it should come as no surprise, that ...


3

If you highlight all the brackets on the right side of what you want, and then do File->Save Selection As you should get this. nb = CreateDocument[{TextCell["PDF Test", "Section"], {Table[PieChart@Range@5, {7}]} // TableForm}]; I transposed the list so it reads left to right and put it in table form to get rid of the brackets. nb = ...


3

It seems to be fixed on 10.3 (at least at a trivial level) for macos Export["test.pdf", Hyperlink["Wolfram Research, Inc.", "http://www.wolfram.com"]] (* test.pdf *) Run["Open test.pdf"] and the link works


3

I would use the approach suggested by Simon Rochester above. Just do enough PDF parsing to extract the DOI or URL of the web page for the paper, then use that information to either extract 'Cited by' information directly from the paper's publisher web page, or get the same information by passing the paper's details to Crossref, Google Scholar or one of the ...


3

Here is what I got using V10.3: As you can see, V10.3 maintains all of the formatting when converting to pdf. I checked, just to make sure, and the PrintingStyleEnvironment is set to "PrintOut".


3

According to the Documentation page for PDF format (under the "Options" section) there is "TextOutlines" option which controls "whether to import characters as outlines". You should set it to False for importing text as characters instead of outlines: Import["test.pdf", "TextOutlines" -> False] Note that this feature can work incorrectly when ...


2

Unfortunately, on version 10.3 the solutions proposed by Jens do not seem to work in at least some situations (see edit on this other question). A workaround that I found to work well in my case is simply using GraphicsRow, which seems to automatically correctly tweak the options of Inset in a way that produces the expected result. If the 3D graphics to ...


2

Funnily enough, when I tried this in version 10 (10.1 and the recently released 10.3), the legend didn't show at all. But in version 9 it does, and I assume that is what you were using given the timing of your question and the format of the graphic you posted. I have not been able to replicate your problem in either Windows or Mac versions of Mathematica ...


2

You need to set the size of the elements of the scorecard. Have a look at Histogram's ImageSize option. Also you can set your tables in Grid or TableForm wrapped in a Pane or Panel to get them the size you want as well. They have ImageSize options as well. To help with the ImageSize parameters make use of UnitConvert to convert from your know dimensions in ...


2

This may be a workaround : Export["test.pdf", Plot[0, {x, 0, 1}, Frame -> True, FrameLabel -> {"c", ToString[\!\(\*FractionBox[\(a\), \(b\)]\)]}]] Simply wrap ToString around and you will get the correct output.


1

Analysis I have taken a look at your misbehaving PDF file generated by Mathematica 10.2 on Mac OS X and here are my observations: Your PDF file should use 83 different fonts which names are listed in it. But the pdffonts utility (a part of Poppler utilities version 0.34) lists only 80 fonts (the listing is here). The missing fonts are: "Bookshelf Symbol ...


1

(Not an answer, just an extended comment.) I do not experience such problem with PDF files Exported by Mathematica 10.2 under Win7 x64 when opening them with Illustrator 17. The following is my check up. Let us generate a Graphics containing all the fonts available for Mathematica: test = Graphics[{MapIndexed[ Text[Style[#, 10] -> Style["text", 20, ...


1

It looks like setting Compatibility: Acrobat 4 (PDF 1.3) in the Save Adobe PDF dialog in Illustrator solves the issue (checked with Illustrator 17): In the resulting PDF file the transparency is flattened without rasterization (here "Untitled-1.pdf" is PDF file generated by Illustrator from blank document where the Exported file "pl.pdf" was Placed): (* ...


1

Seems to export well (v10.0.2 OSX) this way : plot = Plot[x, {x, -1, 1}, Frame -> True, FrameLabel -> {"x", Rasterize[Style[OverBar[Pane@x], 14, FontFamily -> "Helvetica"], RasterSize -> 200]}]


1

Downgrade from Mathematica 10.0.2 back to 10.0.1. This can be done using a Time Machine backup if you have one on Mac OS. That fixed it for me, and there is nothing particular in 10.0.2 that I need, as far as I know.


1

It is not really an answer, but if you select this expression and go to Menu/Evaluation/EvaluateInPlace you will repair your formula. May be this helps. You might also want to define a simple function to apply it to each your expression to prevent any its unwanted reformatting. like this, for example: rE[expr_] := Rasterize[Evaluate[expr] // ...


1

(per Mike's comment). In Mathematica 9, the save as pdf produces more reasonable results after selecting: File -> Printing Settings -> Printing Environment -> Printout


1

This isn't a real solution to the Export As PDF problem but it is a useful workaround in case other workarounds like reverting back to MMA 10.0.1 or using Export instead of Save As don't work for you (as was the case for me since I was already in MMA 10.0.1 and had used Export). You could of course always export as a raster graphics format like JPEG or PNG ...


1

Try to avoid transparent Ticks, or FontSize -> 0, probably this is a problem for PDF. Instead you can define your Ticks directly without Labels, if you want to have them like that. V[r_] := Exp[-2 (r - 1)] - 2 Exp[-(r - 1)] p = Plot[V[r], {r, 0, 5}, Ticks -> { {#, ""} & /@ Range[0, 5, .5], {#, ""} & /@ Range[-1, 1, .25]}, AxesLabel -> ...


1

If you want an overall page title and a different label on each subfigure: Column[ {Text[Style["Here are all my graphs", 24, Bold, Blue]], Grid[ Partition[ Table[ ListPlot[RandomInteger[{0, 10}, 10], ImageSize -> 400, PlotLabel -> "Figure number " <> ToString[i]], {i, 9}], 3]]}, Alignment -> Center]



Only top voted, non community-wiki answers of a minimum length are eligible