I am trying to export a layout which is set to A4 size to a PDF file with option /W=(0,0,0,0) for a full page, but Igor still cuts the page to the size of the graph inside the layout (which is smaller than the full page). Is it possible that I do something wrong.
The feature of SavePICT/W=(0,0,0,0) on a page layout writing the full page was added in Igor Pro 6.10 in 2008. However, I can find no version of Igor in which it worked correctly. From 6.10 through 6.34, it exports a full but blank page. From 6.35 through 6.37, it acts as if /W were omitted and exports the part of the page that is used plus a margin.
After spending quite some time looking into fixes for this problem, I decided not to fix it for Igor Pro 6.x as the fix would likely create new bugs. I have included below a user-defined function that you can use instead. I plan to remove the statement about /W=(0,0,0,0) from the Igor6 manual.
The feature does appear to work correctly in Igor7.
// WriteLayoutFullPage(layoutName, pathName, filePath, exportType, resolution, overwrite) // Writes a page layout to a graphic file using the full page including margins. // Example: // WriteLayoutFullPage("Layout0", "OutputPath", "Test WriteLayoutFullPage.png", -5, 72, 1) // If you provide a symbolic path name via pathName and filePath is "", it uses a default file name // consisting of the layout name with the appropriate extension - e.g., "Layout0.png". // Otherwise, if you pass "" for pathName and filePath is not a full path, it displays the Save File dialog. // It also displays the Save File dialog if the file specified by pathName and filePath exist and you pass 0 for overwrite. Function WriteLayoutFullPage(layoutName, pathName, filePath, exportType, resolution, overwrite) String layoutName // Name of layout window or "" for top layout window String pathName // Symbolic path name or "" String filePath // File name, partial path relative to symbolic path or full path Variable exportType // Export type code as described under SavePICT /E Variable resolution // Export resolution as described under SavePICT /B // resolution makes a difference only for bitmap formats Variable overwrite // 1=overwrite existing file, 0=display Save File dialog if existing file
if(overwrite) SavePICT/P=$pathName/E=(exportType)/B=(resolution)/W=(left,top,right,bottom)/O as filePath else SavePICT/P=$pathName/E=(exportType)/B=(resolution)/W=(left,top,right,bottom) as filePath endif End
January 14, 2016 at 11:59 am - Permalink
January 14, 2016 at 04:11 pm - Permalink
The feature of SavePICT/W=(0,0,0,0) on a page layout writing the full page was added in Igor Pro 6.10 in 2008. However, I can find no version of Igor in which it worked correctly. From 6.10 through 6.34, it exports a full but blank page. From 6.35 through 6.37, it acts as if /W were omitted and exports the part of the page that is used plus a margin.
After spending quite some time looking into fixes for this problem, I decided not to fix it for Igor Pro 6.x as the fix would likely create new bugs. I have included below a user-defined function that you can use instead. I plan to remove the statement about /W=(0,0,0,0) from the Igor6 manual.
The feature does appear to work correctly in Igor7.
// Writes a page layout to a graphic file using the full page including margins.
// Example:
// WriteLayoutFullPage("Layout0", "OutputPath", "Test WriteLayoutFullPage.png", -5, 72, 1)
// If you provide a symbolic path name via pathName and filePath is "", it uses a default file name
// consisting of the layout name with the appropriate extension - e.g., "Layout0.png".
// Otherwise, if you pass "" for pathName and filePath is not a full path, it displays the Save File dialog.
// It also displays the Save File dialog if the file specified by pathName and filePath exist and you pass 0 for overwrite.
Function WriteLayoutFullPage(layoutName, pathName, filePath, exportType, resolution, overwrite)
String layoutName // Name of layout window or "" for top layout window
String pathName // Symbolic path name or ""
String filePath // File name, partial path relative to symbolic path or full path
Variable exportType // Export type code as described under SavePICT /E
Variable resolution // Export resolution as described under SavePICT /B
// resolution makes a difference only for bitmap formats
Variable overwrite // 1=overwrite existing file, 0=display Save File dialog if existing file
String info = LayoutInfo(layoutName, "LAYOUT")
String paperSizeStr = StringByKey("PAPER", info) // e.g., "0,0,612,792"
Variable left, top, right, bottom
sscanf paperSizeStr, "%g,%g,%g,%g", left, top, right, bottom
if (overwrite)
SavePICT/P=$pathName/E=(exportType)/B=(resolution)/W=(left,top,right,bottom)/O as filePath
else
SavePICT/P=$pathName/E=(exportType)/B=(resolution)/W=(left,top,right,bottom) as filePath
endif
End
January 15, 2016 at 11:50 am - Permalink