User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the XML, XSLT and XPATH section within the Software Development category of DaniWeb, a massive community of 457,723 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,831 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our XML, XSLT and XPATH advertiser: Programming Forums
Views: 674 | Replies: 2 | Solved
Reply
Join Date: Aug 2008
Location: Uden, Netherlands
Posts: 13
Reputation: miepmuts is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
miepmuts miepmuts is offline Offline
Newbie Poster

text file to pdf using xsl/svg problems

  #1  
Sep 26th, 2008
Hi everyone,

I am trying to convert a textfile eventually to a pdf file with a visualization of information in the text file.

I use Java to convert the text file to an xml file, and fop to convert the xml together with an xsl file to a pdf containing svg images.

I'm almost finished and I'm down to the last hurdle. Putting the image pointed by a filename into the svg image. At this point I'm stuck with two problems:

1. The text files can be generated by 2 different applications. For the first application the filename works fine. But when executing on a file generated by the second application it fails with the error:
The URI "c://\test_image.tiff" on element <image> can't be opened because:
The URI can't be opened:
Unable to make sense of URL for connection

When I watch the original textfile and the xml file, the path looks like: c:\test_image.tiff. I can't see any distinction between the paths from both applications.
Can someone explain where the // in the filename from the error come from (because I think there's the problem), and how I can get rid of them?

2. I want to show the image (pointed by the filename) inside my svg image. But I need to rotate the image 90 degrees. I managed to do that, but then the image isn't the right size anymore.
I suspect that the image is placed in the svg, and scaled to fit the view, and when rotated, doesn't alter it's size anymore.

Here is the code to display the image:

  1. <!-- Draw Bitmap -->
  2. <svg:g transform="rotate({$bitmap_rotation}, {$width_middle}, {$height_middle})">
  3. <svg:g transform="translate({$svg_bitmap_width_offset},{$svg_bitmap_height_offset})">
  4. <svg:image width="{$svg_bitmap_width}" height="{$svg_bitmap_height}" xlink:href="{$bitmap_path}">
  5. <svg:title>Front Bitmap</svg:title>
  6. </svg:image>
  7. </svg:g>
  8. </svg:g>

All the variables are determined somewhere else from the xml input.

Can someone help me to get the image at the correct size?

Thanks in advance,

miepmuts
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2008
Location: Uden, Netherlands
Posts: 13
Reputation: miepmuts is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
miepmuts miepmuts is offline Offline
Newbie Poster

Re: text file to pdf using xsl/svg problems

  #2  
Sep 30th, 2008
Some update:

On problem 1 I think the fact that it works on the files generated from the first application is just a coincedence. So I like to know how I can transform a Windows path to an URI in Java (but I will ask that question on the Java forum.

On problem 2 I understand I have to do something with scaling the image. But I still need a solution for that problem.
Reply With Quote  
Join Date: Aug 2008
Location: Uden, Netherlands
Posts: 13
Reputation: miepmuts is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 2
miepmuts miepmuts is offline Offline
Newbie Poster

Re: text file to pdf using xsl/svg problems

  #3  
Oct 10th, 2008
I solved my problems.

1. I used Java functionality while parsing the input file to xml. The input string was transformed to an URI, which was printed into the xml again.

2. I didn't have to scale my images, but switch the width and height attribute made the image large enough, after that it was a correction on the position of the image, and it was at the right size at the right place.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb XML, XSLT and XPATH Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the XML, XSLT and XPATH Forum

All times are GMT -4. The time now is 7:09 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC