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 ...


8

By default plot markers are glyphs from a Mathematica font: Graphics`PlotMarkers[] {{"\[FilledCircle]", 8.96}, {"\[FilledSquare]", 8.96}, {"\[FilledDiamond]", 10.88}, {"\[FilledUpTriangle]", 10.24}, {"\[FilledDownTriangle]", 10.24}, {"\[EmptyCircle]", 10.24}, {"\[EmptySquare]", 10.24}, {"\[EmptyDiamond]", 10.24}, {"\[EmptyUpTriangle]", 11.136}, ...


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

On MMA 10.3 on OSX 10.10.5 I get the same behaviour as @chuy - blunt on the front end and both export formats. I think the implementation is kind of buggy as one might expect the option JoinForm -> "Miter" to solve the problem, however it changes nothing. However, using the additional option JoinForm -> {"Miter",d} does create the desired behaviour ...


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 ...


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, ...


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

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 ...


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

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

How are you producing the pdf? What operating system are you using? You haven't included any code, but in my attempt I don't reproduce your problem, GraphicsRow[{ Plot[(20 Exp[-t/2] + 2 Exp[-t/20] Cos[t] + 3), {t, 0, 50}, PlotLabel -> "Price 1"], Plot[(30 Exp[-t/2] - 2 Exp[-t/5] Cos[t] + 14), {t, 0, 50}, PlotLabel -> "Price 2"], ...


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 ...


1

In this case, it seems that changing the background color to have opacity one solved the problem. I think Mathematica is very poor at exporting vector graphics, and the generated file is much heavier than it should be. There were very good insights in the discussions provided in MarcoB's comment.


1

Select the cell with the plots Copy-paste into a new empty notebook File -> Printing Settings -> Page Setup... Choose paper size A3 and landscape Save as a new pdf Go to https://www.cutepdf-editor.com/edit.asp Upload pdf and crop it and save it I have experienced that some of the symbols from mathematica (such as capital gamma) appear wrong when the file ...


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): (* ...



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