| <<<Back 1 day (to 2021/01/18) | Fwd 1 day (to 2021/01/20) >>> | 20210119 |
CrystalMath | hi all | 14:42.52 |
| is there any way to magnify a PDF with ghostscript? | 14:43.02 |
| so that it just looks at double its size? | 14:43.07 |
| everything neatly scaled in proportion | 14:43.14 |
artifexirc-bot | <KenSharp> the scale operator | 14:47.21 |
| <KenSharp> Or FitPage | 14:47.26 |
| <KenSharp> But obviously start by making the media the size you want, set -dFIXEDMEDIA so the PDF doesn't change it, and then set -dFitPage | 14:47.55 |
CrystalMath | i just want exactly double of what it is now | 14:49.29 |
| so i probably need the scale operator | 14:49.35 |
artifexirc-bot | <KenSharp> scale is harder to use, and you'll still need to set the media size, because if you scale the content without changing the media size then 3/4 of it won't fit on the page | 14:50.15 |
| <KenSharp> You need to change both the Media Size and teh scale of the contents | 14:50.46 |
| <KenSharp> FitPage is the easiest way to do that | 14:50.53 |
CrystalMath | hmm, i see | 14:51.50 |
| so i need to first find the current size (because i honestly don't know) | 14:52.10 |
| 272.126x362.835 | 14:53.54 |
| that's a pretty strange size | 14:54.46 |
| can't i just set the media size to 2x of whatever it is? | 14:55.31 |
| 200%? | 14:55.34 |
artifexirc-bot | <KenSharp> Yes, but you have to tell Ghostscript what that is. No you can't just say 'times 2' | 14:55.59 |
| <KenSharp> You can use pdf_info.ps to find the Box values for a PDF | 14:56.43 |
CrystalMath | hmm | 14:56.50 |
| it appears that my scale ratio is 4:3 | 14:56.57 |
| so | 14:56.58 |
| maybe i can just put 640x480 | 14:57.02 |
| it's not quite double, but | 14:57.07 |
| it'll do | 14:57.09 |
artifexirc-bot | <KenSharp> 640x480 points will be very small | 14:57.17 |
| <KenSharp> well relatively small | 14:57.26 |
CrystalMath | well it's 272.126x362.835 now | 14:57.31 |
artifexirc-bot | <KenSharp> And those units are what ? | 14:57.38 |
CrystalMath | i'm not sure... this is what gv tells me | 14:57.53 |
| it says | 14:57.57 |
artifexirc-bot | <KenSharp> Can't help with gv don't kow anything about it. | 14:58.04 |
CrystalMath | y272.126x362.835 | 14:58.06 |
| how do i get the size? | 14:58.13 |
| with gs? | 14:58.15 |
artifexirc-bot | <KenSharp> If you use pdf_info.ps it will give you the values for teh Boxes in points | 14:58.17 |
| <KenSharp> ghostpdl/lib/pdf_info.ps | 14:58.43 |
| <KenSharp> Usage is contained in comments at the head of the file | 14:58.58 |
| <KenSharp> But basically gs -dNODISPLAY -sFile=<input filename> /ghostpdl/lib/pdf_info.ps | 14:59.27 |
chrisl | pdf_info.ps isn't in lib/ | 15:00.15 |
artifexirc-bot | <KenSharp> Err obviously you may have to adjust the path to the PostScript program | 15:00.22 |
CrystalMath | Page size: 362.835 x 272.126 pts | 15:00.25 |
artifexirc-bot | <KenSharp> chrisl it isn't ? It is in mine | 15:00.33 |
CrystalMath | i got that with pdfinfo | 15:00.34 |
artifexirc-bot | <KenSharp> OK well that's in points then. | 15:00.44 |
| <KenSharp> A small page | 15:00.46 |
CrystalMath | yep, that's the problem | 15:00.50 |
| latex beamer makes small pages | 15:00.53 |
| i want to double it at least | 15:00.58 |
| i tried asking on #latex, apparently there's no way to make it scale up, so i have to scale up the PDF (or PS, DVI, etc...) | 15:01.32 |
artifexirc-bot | <KenSharp> So use -dDEVICEWIDTHPOINTS=726-dDEVICEHEIGHTPOINTS=544 -dFIXEDMEDIA -dFitPage | 15:01.49 |
chrisl | We moved pdf_info.ps in Dec 2019, so probably most distros haven't got it yet | 15:02.02 |
artifexirc-bot | <KenSharp> That sets the media size to (more or less) 2x width and 2xheight, tells GS not to allow the PDF file to change it, and instructs it ti scale the content to fit the media | 15:02.37 |
CrystalMath | i'll use 800x600, nicer numbers | 15:02.39 |
artifexirc-bot | <KenSharp> Whatever works 🙂 | 15:02.50 |
| <KenSharp> @chrisl I should delete the zombie copy I have then..... | 15:03.01 |
| <KenSharp> Where are we keeping it now ? | 15:03.26 |
| <chrisl> @KenSharp We moved it *to* lib - it used to be in toolbin/ | 15:03.34 |
| <KenSharp> Umm, so it **is** in lib now ? | 15:04.12 |
artifexirc-bot | <KenSharp> is confused | 15:04.20 |
| <chrisl> In git, it is in lib/ | 15:04.57 |
| <KenSharp> OK then I'm good. If the distro's haven't caught up I won't care 🙂 | 15:05.13 |
sam_ | hehe | 15:08.40 |
CrystalMath | i use debian so all my stuff is super old | 15:09.25 |
| and i'm switching to slackware, so going even older | 15:09.34 |
| thanks for the help :) | 15:10.06 |
artifexirc-bot | <KenSharp> Well, I hope your Ghostscript is new enough to to what I suggested..... | 15:10.20 |
sam_ | looks like slack is up to date | 15:11.36 |
chrisl | Crumbs, that's a phrase I haven't heard in a long time..... | 15:11.59 |
CrystalMath | yes it works | 15:12.47 |
artifexirc-bot | <KenSharp> OK well you can play with the sizes to get different scales | 15:13.01 |
| <KenSharp> I think (memory is fallible) that it only scles isomorphically. ie the same in each direction. So whichever amount is the minimum needed to make it fit, that's what it uses for the x and y scale | 15:13.43 |
| <KenSharp> I think (memory is fallible) that it only scales isomorphically. ie the same in each direction. So whichever amount is the minimum needed to make it fit, that's what it uses for the x and y scale | 15:13.56 |
| <KenSharp> I also think it will rotate the content to fit the media if it requires less scaling. Not that it will affect you but for future reference | 15:14.34 |
CrystalMath | any way to get gs to edit a pdf file in-place? | 15:15.16 |
chrisl | That's not what gs is for | 15:16.06 |
artifexirc-bot | <KenSharp> You can't realistically edit a PDF file with Ghostscript | 15:16.24 |
| <KenSharp> You can create a new PDF file with some kinds of changes (eg rescaling) but not editing | 15:16.50 |
CrystalMath | no i mean | 15:16.51 |
| i want to apply this scaling, and then overwrite the original | 15:16.59 |
artifexirc-bot | <KenSharp> You absolutely can't overwrite the original in one pass. | 15:17.18 |
CrystalMath | i guess i'll just need to use a temporary file | 15:17.26 |
artifexirc-bot | <KenSharp> Ghostscript will be reading from teh input file while it writes the output file | 15:17.29 |
CrystalMath | <rant>i just don't understand why latex just can't scale the output... it's nuts, and why are the only font sizes 10, 14, and 17? are they Donald Knuth's lottery numbers?</rant> | 15:24.48 |
artifexirc-bot | <KenSharp> can't help with that either 😄 | 15:25.12 |
ray_laptop | CrystalMath: BTW, if you like pixels more than points you can use -g800x600 which also locks the media size to that number of pixels wide x high | 16:23.40 |
| (a lot more terse than -r72 -dDEVICEWIDTHPOINTS=800 -dDEVICEHEIGHTPOINTS=600 -dFIXEDMEDIA ) | 16:25.06 |
artifexirc-bot | <KenSharp> @RayJohnston since you would also have to set the resolution if you use -g, which you **don't** if you use DEVICEHEIGHT and DEVICEWIDTH, and you would actually have to calculate the pixel width, I think that is much less true than you imply when using pdfwrite | 16:26.13 |
CrystalMath | huh | 16:29.01 |
| -g800x600 | 16:29.07 |
| makes it super small | 16:29.09 |
artifexirc-bot | <KenSharp> Yes it will | 16:29.13 |
| <KenSharp> Because the default resolution for pdfwrite is 720 dpi | 16:29.21 |
| <KenSharp> So 800x600 is ~1 inch square | 16:29.36 |
| <KenSharp> Hence my point about having to set the resolution as well. | 16:29.48 |
| <KenSharp> I would stick with DEVICEHEIGHTPOINTS and DEVICEWIDTHPOINTS | 16:30.04 |
| <KenSharp> especially since you have the MediaBox in points already | 16:30.16 |
CrystalMath | i'm now doing latex to make a .dvi, dvips to make a .ps, and then gs with those parameters to make a .pdf | 16:31.53 |
| works like a charm | 16:32.20 |
| <<<Back 1 day (to 2021/01/18) | Forward 1 day (to 2021/01/20)>>> | |