Shortly after marrying Anna Rosina Grafenweger in 1672, Valvasor acquired Bogenšperk Castle near Litija, where he arranged a writing, drawing and printing workshop. Valvasor spent a fortune on the publishing of his books; towards the end of his life, his debts forced him to sell Bogenšperk Castle, his vast library and his collection of prints. In 1690, Aleksandar Ignacije Mikulić, the Bishop of Zagreb, bought his library, along with some 7,300 graphics, and moved it to Slavonia, where the collection became part of the library of the Zagreb Archbishopric, now part of the Croatian State Archives. Valvasor died in September 1693 in Krško. He is believed to have been buried in the family crypt at Medija Castle, but this is uncertain. The Yugoslav Partisans dynamited the castle in 1944 and no trace of his putative grave remains today.