The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Export Graphs as MultiPage PDF

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Mulvenna Posted - 11/13/2013 : 03:35:35 AM
Origin Ver. 8.6
Operating System: Windows 7

Hi,

I was wondering is it possible to export multiple graphs to a multipage PDF document?

I can only find the X-Function to export a worksheet in this format.

At the minute my script outputs about 40 PDFs, it would be amazing if I could combine these into about 3 or 4 documents instead.

Regards,
Conor
8   L A T E S T    R E P L I E S    (Newest First)
Castiel Posted - 11/20/2013 : 11:51:23 AM
I use Ghostscript to merge PDFs. First, list all PDFs to be merged, for example
dir /B *.pdf>pdflist.txt

Then execute a command like
gswin32c -o merged.pdf -sDEVICE=pdfwrite -dNOPAUSE -dBATCH Graph1.pdf Graph2.pdf Graph3.pdf


The PDF Origin exports seems to be PDF-1.2. I've been thinking about parsing them with Origin C and then merging them. It may be nothing more than correcting obj's offset and index and updating the xref part...anyway, Ghostscript works.

©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦
Hideo Fujii Posted - 11/20/2013 : 10:13:38 AM
Just an additional info for people who come by this thread,

As an easy work-around, you can send the graphs in your project or in a folder to PowerPoint (by right-clicking the folder in the Project Explorer), which opens it automatically, then you can save the PP slides to a PDF file. Though this may be less fine controllable than scripting, you can at least control the margins when you send graphs to PP.

--Hideo Fujii
OriginLab
greg Posted - 11/19/2013 : 10:34:03 AM
Those options do not appear in either the dialog, nor in the self-documenting help:
exppdfw -h
so it looks like they are just not working. You can try the
tr3.useown:=1
option and use Page Setup to set the margins. Most printers ( whose properties Origin references when rendering a page ) have some minimum margin so you may find those values do not 'stick'. Depending on printer setup, you may find you cannot even enter a margin of 0.
Mulvenna Posted - 11/19/2013 : 06:07:58 AM
Thanks greg, I have it working great. Just wondering are the options on this page not available? This is where I found the margin options:

http://www.originlab.de/www/helponline/Origin/en/programming/mergedProjects/X-Function/X-Function/ExpPDFw.html
greg Posted - 11/15/2013 : 12:23:43 PM
I am not sure where you were getting your tr3 properties from, but they do not match the expPDFw tr3 properties. Oddly, Origin does not complain and creates the PDF anyway.

I am not sure any of the settings will get you the margin you require.

You can use the following procedure and script to manually tweak the cell sizes to get what you want:

Turn on Page Break Preview Lines ( under the View menu ) so you get indicator of where Page Breaks occur.
Select all rows (do not include header, do not select whole worksheet).
Resize the first row just enough so that a page break occurs between row 1 and row 2. (This can be difficult to see since the selection is all black, but when you when you get to the right size, a dashed, blue line will appear at the bottom of row1.)
Here's the trick to sizing the column:
If you size the column smaller, the graph (eventually) starts to shrink.
If you size the column larger, the graph (eventually) stops getting larger and instead starts shifting to the right.
You want your column size to be at the 'magic' point at which this change takes place.

Assuming you have assigned values to tr$, date$ and PDFname$, then this script should do it:

strPath$ = "%Y01_Technology_Testing\";
strFile$ = "%(tr$)_%(date$)_%(PDFname$)";
expPDFw path:=strpath$
filename:=strfile$
overwrite:=rename
tr3.UseOwn:=0.
tr3.Check.Chk_Frame:=0.;
Mulvenna Posted - 11/14/2013 : 06:23:28 AM
Ok, I found how to do it but I can't seem to get it to do exactly what I want, could someone (greg) :P help me out with what Im doing wrong please?

expPDFw path:=%Y01_Technology_Testing\ filename:="%(tr$)_%(date$)_%(PDFname$)" overwrite:=replace tr2.MultiPage.Pagination.Top:=2. tr3.UseOwn:=0. tr3.Check.Chk_Frame:=0. tr3.Margin.Top:=0. tr3.Margin.Bottom:=0. tr3.Margin.Left:=0. tr3.Margin.Right:=0.;

Everything works fine except the tree node options. Basically I want it to have:

No Frame;
No margins at all!;
Page Numbers in the top right corner.
Mulvenna Posted - 11/14/2013 : 02:49:10 AM
Thanks Greg that works great.

Just one question though, is there any way to set the margin to 0? Each page of the PDF has a margin added to all sides. It's slightly better when I use "keepAspect=0" when inserting the graph but its still squashed down a little on export.

Not a huge problem obviously but would be nice to have the original size.

Thanks again for the help.
Mulvenna
greg Posted - 11/13/2013 : 12:37:52 PM
We do not have this option yet, but it's not that difficult to do...

Copy all your graphs to a new folder. (Unless they already are all in one folder and there are no other graphs.)
Open a new Workbook and Maximize it.
Delete the second column and resize the column width to fill the workbook.
Remove the Long Name, Units and Comments Header rows.
Set the number of rows to the number of graphs. (e.g. wks.nrows = 40;)
Select all these rows.
Drag the row separator between row 1 and 2 down until the one cell fills the workbook.
Now run this script:
// BEGIN SCRIPT
row = 1;
doc -ef P {
insertGraph gname:=%H
embed:=0
resizecell:=0
axes:=0
cell:=[Book2]1!1[row:row];
row++;
}
// END SCRIPT
(Be sure to change "[Book2]" to be the name of your new book.)

That creates large links to your graphs in each cell. Now you can use the Export as MultiPage PDF option (expPDFw X-Function) to create a single, multipage PDF.

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000