![]() |
|
PDF Generation update - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Programs (https://qb64phoenix.com/forum/forumdisplay.php?fid=7) +---- Thread: PDF Generation update (/showthread.php?tid=4165) |
PDF Generation update - justsomeguy - 11-29-2025 Hello all, Here is a small update to my pdfGenerator(https://qb64phoenix.com/forum/showthread.php?tid=3504). I've added a few minor commands since my last update, and started work on some proper documentation. In the files, I have included a demo that generates a small book of holiday mazes for kids to solve along with solutions. Note: The generation is slow, about 5 to 10 minutes. ![]() If you examine the library files (pdfGen.bm) you may notice there is some peculiar notations in the comments. That is part of my documentation project. I figure users would look at the library first, and then at the docs. So, I figured I would write the docs once in the library and use pdfGen to extract the docs from the library. At some point I will post it to my github, but I have lost quite a bit of work on there, because I'm such an amateur at it. For those of you that are nervous about .zip files from strangers on the internet, I've included all the necessary files, but you will have to make sure the filenames are correct. These are the files located in the zip file. File names of the silhouettes in no particular order. Bell.png CandyCane.png ChristmasTree.png GingerBreadman.png Present.png SantaHat.png sleigh.png Stocking.png Turkey.png The following are the silhouettes for the mazes. ![]()
RE: PDF Generation update - Mad Axeman - 11-29-2025 Hi Glad to see you are still working on the project. I'm away from my PC until Tuesday. I'll take a look when I get back. What are the minor commands that you've added? RE: PDF Generation update - justsomeguy - 11-29-2025 Quote:What are the minor commands that you've added?I've only added three. They were helpful in my maze book project. Code: (Select All) SUB pdfSetLineCapStyle (c AS LONG)pdfSetLineCapStyle sets what the end caps of a line segment should look like. ![]() pdfSetLineJoinStyle sets how the connected line appear. ![]() pdfSetLineDashPattern changes the lines to dashed or dotted lines.
RE: PDF Generation update - Mad Axeman - 12-21-2025 Finally got around to looking at the update. One thing you may want to alter is line 67 of pdfGen.bm At the moment it's Print "Doh! I'm the library not the main program!" I don't think that's needed ![]() I have altered the file just a little. I've remed out the logFile section. It's not something I need. Apart from that it's great. I ran the maze demo and printed them out for my wife. She seemed happy and hopefully it'll keep her quiet for a while. RE: PDF Generation update - Mad Axeman - 12-21-2025 Have you broken something? I've just run a little test with the old and new .bm and .bi files. I've got the following lines in my demo ' Code: (Select All)
With the old .bm and .bi files the PDF creates either landscape or portrait depending on which I've got unremmed. With the new .bm and .bi files the the PDF size is wrong The demo prog I'm using is below in case you want to see what I'm doing. The two test text files are also attached (I hope!) Code: (Select All)
RE: PDF Generation update - justsomeguy - 12-21-2025 I have been plugging away at proper documentation and making small updates and bug fixes. I'm not exactly sure what you are seeing, but I discovered that if you do not make the crop box the same as the media box, it won't work correctly. I made it to where media box will change the crop box to match in this last version. I included the latest libraries and the UNFINISHED docs that I have currently have. If you are adding huge blocks of texts to your document you might look at pdfAddTextBlock or pdfAddTextBlockEx. RE: PDF Generation update - Mad Axeman - 12-21-2025 I know, I didn't explain my problem very well. Basically, if I was rem out line 17 and unrem line 20 (set to portrait) then rem line 56 and unrem line 57 (header.txt) then everything printed okay in portrait mode. If I then swap things around, rem out line 20 and unrem line 17 (landscape mode) and unrem line 56 and rem line 57 (header-wideorig.txt) then the PDF would be created in landscape mode but the text would carry on off page. I've just tried it with the latest .bi and .bm files and it now seems to work fine so I'm a happy bunny. It still prints ' Doh! I'm the library not the main program' though :-) The docs seem pretty good so far. Looks like I need to do some reading. RE: PDF Generation update - justsomeguy - 12-22-2025 That makes sense. You will have to reduce the font size or reduce the amount of text, to get it to fit in the page. It does not scale the text based on width, it will simply cut it off. It can't determine the width of a font with any reliability, because that is dependent on what you are using to view the pdf. I can make some guesses, but I decided to leave that up to the end user. I always put and END or SYSTEM before the '$INCLUDE:'pdfGen.bm' to keep 'Doh! I'm the library not the main program' message from popping up. I use that message to warn me not to compile the library (which happens a lot), but to compile the program using the library. Your more than welcome to delete it, if it is a inconvenience. |