Board Logo
« Write a PDF file »

Welcome Guest. Please Login or Register.
Jan 16th, 2018, 3:32pm


Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Please use the forums Search feature before asking.
Please post code using the code box described in Format Your Messages.
This will keep indentation, separate it better form the message and prevent gibberish.
If the code is too long for one post or additional files are needed, upload a ZIP archive to the Just BASIC Files Archive Site.

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Write a PDF file  (Read 236 times)
Angelo2449
Member in Training
ImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 58
xx Write a PDF file
« Thread started on: Sep 22nd, 2017, 02:23am »

Hi Guys,
I wrote a program that generates a .bmp file, I would also like to get it in PDF format.
Is there any routine that can do it?
Thank you
User IP Logged

Facundo
Board Moderator


member is offline

Avatar




PM

Gender: Male
Posts: 1302
xx Re: Write a PDF file
« Reply #1 on: Sep 22nd, 2017, 10:41am »

Maybe using a virtual printer? or an external utility?
Here are some PDF creation code, by user code xd
Example of making a ugly pdf file
Create pdf with colors...
User IP Logged

cundo aka MSlayer
tenochtitlanuk ( John F)
Full Member
ImageImageImageImage


member is online

Avatar




PM

Gender: Male
Posts: 430
xx Re: Write a PDF file
« Reply #2 on: Sep 22nd, 2017, 11:12am »

Just print the graphics as below, and select 'Print to PDF' rather than any real connected hardware when the dialog comes up. ( I leave that as the default on my machines to save paper wasting)
The '800' states what width you want the graphic to occupy on the page.
Code:
    nomainwin

    WindowWidth  =800
    WindowHeight =600

    open "Demo of graphics saved to a bmp" for graphics_nsb as #wg

    #wg "trapclose quit"

    #wg "fill 140 140 40"

    for i =1 to 10
        #wg "up ; goto "; int ( 700 *rnd( 1)); " "; int( 500 *rnd( 1))
        #wg "down"
        #wg "font arial "; 6 +int( 40 *rnd( 1))
        #wg "color     "; int( 256 *rnd( 1)); " "; int( 256 *rnd( 1)); " "; int( 256 *rnd( 1))
        #wg "backcolor "; int( 256 *rnd( 1)); " "; int( 256 *rnd( 1)); " "; int( 256 *rnd( 1))
        #wg "\"; "Graphics"
    next i

    #wg "print 800"
    '#wg "getbmp scr 0 0 800 600"
    'bmpsave "scr", "graphicEg.bmp"

    wait

    end

    sub quit h$
        close #wg
        end
    end sub

 
User IP Logged

Visit my LB/JB pages at http://www.diga.me.uk/index.html
I use XP and Ubuntu Linux on old machines!
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Conforums Terms of Service | Membership Rules | Home | Search | Recent Posts | Notification | Format Your Message | Installation FAQ

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls