Member Avatar

Hi All, I want to create the following xml from JAVA code. Can u please suggest me a way to write a JAVA code to generate the following xml.When I tried am not able to generate the title with xmlns.Please someone help me..I am very new to XML..... Even if u can provide me a way to generate the first three lines till user will do..Please help........ < ?xml version="1.0" encoding="UTF-8" ?> - <pierRecord xmlns="http://www.mywebsite.com/pier/schema/pier" xsi:schemaLocation="http://www.mywebsitecom/pier/schema/pier record.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <user> <submitterId>Arathy</submitterId> <submitterName>Arathy</submitterName> <sourceDatabase>My System</sourceDatabase> <accessLevel>General Access</accessLevel> <informationSensitivity>Confidential</informationSensitivity> <personalIdentifyInformation>None</personalIdentifyInformation> - <languages> <language>English</language> </languages>?xml version="1.0" encoding="UTF-8" ?> - <pierRecord xmlns="http://www.mywebsite.com/pier/schema/pier" xsi:schemaLocation="http://www.mywebsitecom/pier/schema/pier record.xsd" …

Member Avatar
0
2
Member Avatar

Hi all, I actually need to use a sorted map.So i tried using Tree Map.But the problem is that This works well with sort key having values upto 9. With more than 10 items I see abrupt results with sort key arranged in the order = 1, 10, 11,12,--------17, 2, 3, 4, 5, 6, 7, 8, 9. I even tried using Comparator for this ....But the same way it is sorted...How to make it arrange in the correct order of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11? Please find my code below public static TreeMap sortByComparator(TreeMap …

Member Avatar
0
3
Member Avatar

Hi, I am having a code which fetches say 200 records,after 6 records i got an exception..So after my exception is caught in catch block i have 2 call a method which can help continuing the exception starting from the 7th object. Can anyone help with some piece of code that can help me do this??? Hoping for a favorable response Regards Arathy Nair

Member Avatar
0
4
Member Avatar

Hi all, I have a situation where am using String conditions(say if(name.equalsIgnoreCase(Arathy)). I want to replace this if-else loop with Switch cases..What way i can do to accomplish this?

Member Avatar
0
3
Member Avatar

Hi All, I have PDFs that are to be watermarked. I need to know whether there exists the below options 1 Option is : Whether we can rewrite the same file with the logo instead of taking the existing pdf and writing this pdf into watermarked file option2 : Whether we can add the watermark upon creating the file first time itself? Pleaase do help.... Hoping for a favorable response Thanks in Advance

Member Avatar
0
5
Member Avatar

Hi Friends, I am having a pdf which has to be watermarked.But the code below I use is writing contents of my PDF into another PDf which is being watermarked.Please suggest any ideas which helps me watermark the same pdf without creating a new one. Please find the code below. [code]PdfReader Read_PDF_To_Watermark = new PdfReader(RESOURCE_DATA.getString("FILE_PATH")); int number_of_pages = Read_PDF_To_Watermark.getNumberOfPages(); PdfStamper stamp = new PdfStamper(Read_PDF_To_Watermark, [COLOR="Red"]new FileOutputStream(RESOURCE_DATA.getString("FILE_PATH2")));[/COLOR] int i = 0; Image watermark_image = Image.getInstance(RESOURCE_DATA.getString("LOGO")); watermark_image.setAbsolutePosition(200, 400); PdfContentByte add_watermark; while (i < number_of_pages) { i++; add_watermark = stamp.getUnderContent(i); add_watermark.addImage(watermark_image); } stamp.close();[/code]

Member Avatar
0
2
Member Avatar

I want to delete the strings file1 and file2 after its merged to a single pdf merge12. Please suggest your valuable ideas.. Thanks in advance package com; import java.io.FileOutputStream; import java.util.ArrayList; import com.itextpdf.text.Document; import com.itextpdf.text.pdf.PdfCopy; import com.itextpdf.text.pdf.PdfImportedPage; import com.itextpdf.text.pdf.PdfReader; /* * author * @282532 */ public class PdfMerger { public static void main(String args[]){ String file1 = "d:\\PR00002.PDF"; String file2 = "d:\\PR00003.PDF"; String mergedFileLocation = "d:\\merge12.pdf"; String filesTobeMerges[] = new String[] { file1, file2 }; mergeMyFiles(filesTobeMerges, mergedFileLocation); } public static void mergeMyFiles(String filesTobeMerged[],String mergedFileLocation){ System.out.println("Starting to merge files..."); System.out.println("total number of files to be merged"+filesTobeMerged.length +"\n"); try{ int pageOffset = …

Member Avatar
0
11

The End.