The following code will print to a paper printer or adobe pdf with no problem, but will not work properly with the Livecode pdf generator.
The case is where there are text fields and an image area printed by a single enclosing rectangle.
During each loop, the text and image fields are propogated and then the enclosing rectangle is printed.
To ensure the image is in place before any enclosing rectangle is printed, I introduced answer and the variable with the current loop count.
The result with the Livecode pdf generator was that only two images of the three pages were visible in the pdf, everything else was fine.
After removing the answer code and the parts to print to pdf and adding answer printer, the result was perfect to paper or adobe.
Similar code to print a page at a time, using livecode "to pdf " also gave perfect results.
Global WorkFolder,TemplateNumber,tFileID,tSelLine,TCurrentPage,TotalPages,VarDeleteLine5,VarDeleteLine7,VarDeleteLine8,VarDeleteLine29
global VarDeleteLine30,VarDeleteLine43,VarDeleteLine44,VarDeleteLine61,VarDeleteLine62
on mouseUp
Local TmpFileNm,NumLines,tempvar
local tHeaderRect,tBodyRect,tFooter1Rect,tFooter2Rect
set the dashes of graphic "FrontBorder"on card 1 to 200,0 --Needed to correct a dases when printing
set the dashes of graphic "Border"on card 2 to 200,0 --Needed to correct a dases when printing
--print routine
reset printing
answer printer --only added to print to paper or adobe during testing
set the formatforprinting of this stack to true
set the printmargins to 50,35,10,10
set the printpaperorientation to "landscape"
set the printcolors to true
--set the printcardborders to true
get the printRectangle
set the printscale to 0.75
open printing --to pdf "Album.pdf" -- Commented out when using adobe or paper
print card 1 from the topLeft of graphic "FrontBorder" on card 1 to the bottomRight of graphic "FrontBorder" on card 1
repeat with tempvar = 1 to TotalPages
put tempvar into tSelLine
call "mouseup" of button "Generate page" on card 2
--answer tempvar -- Only used with livecode to make sure the image had fully appeared on screen before printing
print card 2 from the topLeft of graphic "OuterRect" on card 2 to the bottomRight of graphic "OuterRect" on card 2
end repeat
close printing
--launch document "Album.pdf"-- Commented out when using adobe or paper
set the formatforprinting of this stack to false
--end of print routine
end mouseUp
If anyone wants to see the problem in the context of the application then I can send the stack. Just ask
Printing to pdf has a bug
Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 55
- Joined: Sat Sep 10, 2011 12:22 pm
Return to “Getting Started with LiveCode - Complete Beginners”
Jump to
- LiveCode Community
- ↳ Announcements
- ↳ Developer Services Marketplace
- ↳ User Groups and Events
- ↳ SoCal LiveCode Group
- ↳ Greater Toronto Area LiveCode Users Group
- ↳ Off-Topic
- ↳ Made With LiveCode
- Getting Started With LiveCode
- ↳ Getting Started with LiveCode - Complete Beginners
- ↳ Getting Started with LiveCode - Experienced Developers
- ↳ Converting to LiveCode
- Developing With LiveCode
- ↳ Talking LiveCode
- ↳ Databases
- ↳ Games
- ↳ Internet
- ↳ Multimedia
- ↳ Software Engineering
- ↳ Version Control
- ↳ Feature Proposals
- ↳ Bug Triage
- Extending LiveCode
- ↳ Using Plugins for Customizing the LiveCode IDE
- ↳ Using Externals
- ↳ Making IDE Plugins
- ↳ Building Externals
- ↳ LiveCode Builder
- Platform Specific
- ↳ Windows
- ↳ Mac OS
- ↳ Linux
- ↳ iOS Deployment
- ↳ Android Deployment
- ↳ CGIs and the Server
- ↳ HTML5
- ↳ Raspberry Pi
- Academic Endeavors
- ↳ Teaching with LiveCode
- ↳ Research and Post Secondary
- ↳ LiveCode University
- ↳ Educational Outreach
- Livecode Open Source Archived Forum- closed to posting
- ↳ Engine Contributors
- ↳ IDE Contributors
- ↳ Documentation and Tutorials
- ↳ Brainstorms
- ↳ Community Projects
- LiveCode Hosting