Jump to content
Developer Wiki and Function Reference Links ×

pdf procedures


Recommended Posts

hello all,

for some time I'm trying to find out how the pdf procedures in vectorscript work:

-AcquireExportPDFSettingsAndLocation

-ClosePDFDocument

-ExportPDFPages

-OpenPDFDocument

I tried some things, but nothing happens. The functionreference files are not very instructive.

tia,

Frank Schnater

Link to comment

They actually work togheter.

I changed them to one procedure for easier use:

PROCEDURE ExportToPDF(pages : DYNARRAY of STRING; inSeparateDocuments : BOOLEAN);
VAR
	currentPage, pageResult : INTEGER;
	firstPage, lastPage : INTEGER;
	firstBook, lastBook : INTEGER;
	activeLayer : HANDLE;

BEGIN
	IF AcquireExportPDFSettingsAndLocation(inSeparateDocuments) THEN BEGIN
		activeLayer := ActLayer;
		GetArrayDimensions(pages, firstPage, lastPage, firstBook, lastBook);
		IF inSeparateDocuments THEN BEGIN
			FOR currentPage := firstPage TO lastPage DO BEGIN
				IF OpenPDFDocument(pages[currentPage]) THEN BEGIN
					Layer(pages[currentPage]);
					pageResult := ExportPDFPages(pages[currentPage]);
					ClosePDFDocument;
				END;
			END;
		END ELSE BEGIN
			IF OpenPDFDocument('') THEN BEGIN
				FOR currentPage := firstPage TO lastPage DO BEGIN
					IF GetLayerByName(pages[currentPage]) <> NIL THEN BEGIN
						Layer(pages[currentPage]);
						pageResult := ExportPDFPages(pages[currentPage]);
					END;
				END;
				ClosePDFDocument;
			END;
		END;
		Layer(GetLName(activeLayer));
	END;
END;

The pages variable is an array of layer names.

Link to comment
  • 4 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...